|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
SQL Exact Match
Is there away or function already built in to MS SQL 2000 that will get an exact match for a word. I am using the wild card % % on a search term but this returns words that contain that value also. example:-
If i look for the word "like" it will return results which contain "like" and and "likely". But I'm only looking for the word "like". Thanks |
|
#2
|
||||
|
||||
|
Well it all depends on what you mean by exact match. If you mean that the only word in the field should be 'like' then you can say WHERE some_field = 'Like'. If you mean that the word can be anywhere in that field, then you could try your query without the % and see what you get. If that does not work, try adding a space after the word (provided that you are confident there should be a space there), such as WHERE some_field LIKE 'Like '.
Ultimately what works for you will have to be decided with some testing. I'm afraid there is no magic bullet for this.
__________________
Slarentice (origin:Shadow Wizard of ASP Free) [noun] A slave and apprentice of the Wizard's Circle (specifically of mehere) at ASP Free. ---- If shemzilla takes over, it's best to be on his good side ![]()
|
|
#3
|
|||
|
|||
|
Quote:
Thanks for your reply, I'ved tried your suggestion and it doesn't bring any results back is there any other way? |
|
#4
|
||||||
|
||||||
|
Quote:
I did some more research, and I think I found a solution. Try running this test and you will see what I mean: sql Code:
|
|
#5
|
|||
|
|||
|
Quote: Thanks that works a treat, I imagine a few people will find this thread very useful, thanks again |
|
#6
|
||||||
|
||||||
|
Quote:
I was wondering if you could help me again, I've done some further testing and if like is the only word that appears it doesn't match it, if I put a space before it, it works, is there away around this, if not could you point me in the right direction? Thanks |
|
#7
|
||||||
|
||||||
|
Quote:
sql Code:
|
|
#8
|
||||
|
||||
|
Quote:
|