Need a little help in SQL query...take a look if you are good at it :)

eggman

Adept
In regarding my project, i had to use a bit of SQL and since I"m not good at it I need your help!

Here it goes...

To display all the names that have EXACT MATCH in the database I used this query
Code:
select * from word_location where word =[I]keyword[/I]

where keyword is a variable.

To display all the names that have PARTIAL MATCH in the database I used this query

Code:
select * from word_location where word like %[I]keyword[/I]%

However second query also gives all the Data That Have EXACT match along with partial match.

SOmeone please post a query which only gives PARTIAL MATCH excluding exact match!

:p
 
@eggman

Use this

Code:
select * from word_location where word like %keyword%

MINUS

select * from word_location where word =keyword

You will get what you want
 
@Vasishta.Sushant : Thaks..........your code works :)

I havent tried greenhorn and raksrules 's ...but thanks for the help...I'm sure it's right too:)
 
Back
Top