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 |
|
ryandavebrigino@yahoo.com
Starting Member
9 Posts |
Posted - 2008-07-21 : 22:50:09
|
| good day everyone.regards to visakh16- the syntax from your last reply works. thanks.to day my problem is search.recently i am using the keyword LIKE and my syntax is like this.SELECT ItemName FROM Tbl_ItemMasterfileWHERE ItemName like '%dvd%'and i get a result set of items that contains the word 'dvd'LG DVDSAMSUNG DVDSONY DVDnow my boss wants a SEARCH QUERY that would look something like thisSELECT ItemName FROM Tbl_ItemMasterfileWHERE ItemName like '%dvd tv%'and I need to return the items containing either the word 'dvd' OR 'tv'this is the result set i need to returnLG DVDSAMSUNG DVDSONY DVDLG TVSAMSUNG 14" TVSONY DVD TVIm a beginner in SQL so i only know basics.please be gentle.Thanks... |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-21 : 22:55:59
|
[code]SELECT ItemNameFROM Tbl_ItemMasterfileWHERE ItemName like '%dvd%'or ItemName like '%tv%'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
ryandavebrigino@yahoo.com
Starting Member
9 Posts |
Posted - 2008-07-21 : 23:12:17
|
| thanks for the reply khatanbut the parameter that I need to passed to the query should came from only one textbox.so i cant use 'OR' in the query. what i need to pass is only the string 'dvd tv' and return this result.LG DVDSAMSUNG DVDSONY DVDLG TVSAMSUNG 14" TVSONY DVD TV |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-21 : 23:38:13
|
[code]SELECT ItemNameFROM Tbl_ItemMasterfile INNER JOIN dbo.fnParseList(' ', 'dvd tv') ON ItemName LIKE '%' + Data + '%' [/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|