sachingovekar
Posting Yak Master
101 Posts |
Posted - 2011-09-29 : 08:19:46
|
create table #table1( title6 varchar(100), cnt int)insert into #table1 values ('abc',2)insert into #table1 values ('efg',4)create table #table2( title6 varchar(100),title7 varchar(100),title8 varchar(100),title9 varchar(100),title10 varchar(100),title11 varchar(100))insert into #table2 values ('qwe','abc','efg','hyu','xyz','wer',1)insert into #table2 values ('ilm','abc','efg','hyu','xyz','wer',1)insert into #table2 values ('efg','wer','abc','hyu','xyz','wer',1)insert into #table2 values ('cvb','efg','efg','hyu','xyz','wer',1)insert into #table2 values ('asd','fgh','efg','hyu','xyz','wer',1)insert into #table2 values ('wer','qwe','dfg','efg','xyz','wer',1)insert into #table2 values ('wer','qwe','dfg','sdz','efg','wer',1)I want to search one value at a time :for eg: "abc" from table 1 will be search from title6 to title 11 in table 2the condition is "abc" should be stopped searching when we find 2 rows for abc in table 2 because the count of "abc" is 2 in table 1Imp: once we have found the text "abc" in any row, that row should not be counted again for any other string, it has to be excluded from the searchplease help |
|