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

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.

Hi,

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

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

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

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%'

Did your homework get a good grade after these guys helped you?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.