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 |
|
js.reddy
Yak Posting Veteran
80 Posts |
Posted - 2007-07-12 : 08:35:28
|
| Hi allI have a temptable called #TempPartsthe content of #TempParts may be partname---------gandhinehruindirakarunajayaand here i have one more main table called bookMainThe main table bookMain may containbookname---------Mahatma GandhiIndira GandhiThe story of GandhiJavarlal NehruThe Last Day of Gandhiindirakaruna nidhijaya lalithaHere I want to display all rows from bookMain which are related to #TempPartsI think here we can use IN and LIKE operators. But I am not getting.ThanksJS.Reddy |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-12 : 08:43:24
|
[code]SELECT *FROM partname p INNER JOIN bookname bON b.bookname LIKE '%' + p.partname + '%'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
js.reddy
Yak Posting Veteran
80 Posts |
Posted - 2007-07-12 : 08:53:56
|
Thank you KH quote: Originally posted by khtan
SELECT *FROM partname p INNER JOIN bookname bON b.bookname LIKE '%' + p.partname + '%' KH[spoiler]Time is always against us[/spoiler]
|
 |
|
|
|
|
|