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 |
|
thiyait
Yak Posting Veteran
70 Posts |
Posted - 2006-05-18 : 06:24:19
|
| Hi all; Anyone help me to overcome this problemTable1:EMP---RajasekartimTable2:Description:------------this is the sample timthis is another samplei just need the result of emp from table1 which is contained in table 2 descriptionHere my expected result is Emp---timi have tried with following query:Select emp from Table1 A,Table2 B Where b.Description like '''%'+ a.EMP +'%'''it retrieved nothingThanks in advanceThiya |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-05-18 : 06:37:48
|
Try this Declare @tblEmp Table(Emp Varchar(100))Insert @tblEmp Select 'Rajasekar' Union All Select 'tim'Declare @TblDesc Table (Description Varchar(100))Insert @TblDesc Select 'this is the sample tim' Union All Select 'this is another sample'Select Emp From @tblEmp Inner Join @TblDesc On Description Like '%' + Emp + '%' If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-18 : 08:04:20
|
| >>Select emp from Table1 A,Table2 B Where b.Description like '''%'+ a.EMP +'%'''You overquoted Single quote as if you were using Dynamic SQLMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|