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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Like Operator comparision

Author  Topic 

AsimKhaliq
Yak Posting Veteran

94 Posts

Posted - 2003-12-01 : 14:57:41
hi
is this a correct syntex
SELECT C.Email,ViewerType FROM tab1 as C INNER JOIN tab2 AS G
ON C.EMAIL not like '%'+G.EMAIL+'%'

here email is the common field in both table, and i want to retrieve data based on like comparion

Plz write me if anyone ahve other suggestions
thanks

X002548
Not Just a Number

15586 Posts

Posted - 2003-12-01 : 15:12:03
You need to relate tables together with a Join (ON or in a WHERE clause) and need to limit Results with a predicate (Let's just say in the WHERE clause for now):


SELECT C.Email
, ViewerType
FROM tab1 as C
INNER JOIN tab2 AS G
ON c.Email = g.Email
WHERE C.EMAIL not like '%'+G.EMAIL+'%'



ook up INNER, OUTER LEFT, RIGHT, FULL, and CROSS JOINS in BOL

Happy joining



Brett

8-)
Go to Top of Page
   

- Advertisement -