0

Hi,
Need Help regarding a query.
I want to search all empName from emp table whose name 3rd letter is "s"

3
Contributors
6
Replies
18
Views
3 Years
Discussion Span
Last Post by drjohn
0

How much of your query have you done so far? What progress have you already made?
You could whip something up using single-character wildcards. There might be a better way to achieve this, but the wildcard method will certainly work.

0

Hi,

SELECT * from emp WHERE name LIKE "%S%"
I am not sure about "%S%"

0

That's almost it, except % will match 0 or more characters, which isn't quite what you want. Your current query will match things like:

  • asdf
  • aaa239vjsdio4
  • 123s123

What you could try using is a combination of the % and _ operators

0

SELECT * FROM user WHERE username LIKE '%__m%'
Is above is right.Plz Suggest!!!

0

Almost, just drop that first % sign. You want to match:

Any single character, any single character, "s", any amount of characters

So it'd become '__s%'

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.