|
Iám so new in this, and learning... I could use som help to a problem. I want to search in a table. I´m searching in for lastnames with the letter s in it. How do I do that? (Oracle SQL) I have tried a sevral combinatins now...
(comments are locked)
|
|
You're close. To search for the letter 's' anywhere in the name, you need to add an additional wild card to your search like this: '%s%'. That will find it anywhere within the name. But, understand, that will also lead to a scan of the table and possibly slow performance.
(comments are locked)
|
|
Grant is right - it won't be performant, but it is the answer... As you can see, it's all but identical to the code you showed. The % wildcard matches zero or more characters; there's also an _ wildcard that matches a single character. You can also build up not-quite-regular-expressions: This will show you all names where there's a letter from what I've heard described as "the arse end of the alphabet". There are some other tricks to learn - see the documentation for LIKE for more ideas. Excellent answer, but doesn't performant mean an actor in a play? Ha!
Sep 24 '12 at 10:17 AM
Grant Fritchey ♦♦
I have no idea - I've spent too much time talking to pointy-haired bosses over the years, and it has warped my vocabulary...
Sep 24 '12 at 11:35 AM
ThomasRushton ♦
(comments are locked)
|

