Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ramesh.g
Starting Member
11 Posts |
Posted - 2010-10-05 : 01:56:24
|
| I have sql server table tbljob which has a single field 'criteria'The table has six records as belowcriteria maidmaids dotpotmaidheadI want to write a select query where for example if someone searches for 'maids' it should display 3 records maid, maids, maidORIf someone searches for 'maid' it should display 3 records maid, maids, maidI tried with Select * from tbljob where criteria like'%maids%' but its not working.Please Help. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
ramesh.g
Starting Member
11 Posts |
Posted - 2010-10-05 : 02:44:22
|
| Thank you tara for reply. for example - Select * from tbljob where criteria like 'maids'currently it display 'maids' but should display 'maid' as well |
 |
|
|
Gerten_Utv
Starting Member
7 Posts |
Posted - 2010-10-05 : 03:58:21
|
quote: Originally posted by ramesh.g Thank you tara for reply. for example - Select * from tbljob where criteria like 'maids'currently it display 'maids' but should display 'maid' as well
Select * from tbljob where criteria like 'maid%' |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-10-05 : 12:25:30
|
Either pass in 'Maid%' instead of 'Maids%' or you can do some string manipulation, or can compare them this wayselect * from tbljob where difference (criteria, 'maids') >= 3 |
 |
|
|
|
|
|