Try this

SELECT DISTINCT t1.user, 'true/false' = CASE WHEN (t2.user IS NULL )
THEN 1 ELSE 2 END
FROM tableOne AS t1 LEFT OUTER JOIN tableTwo AS t2 ON t1.user = t2.user


-----Original Message-----
From: Debusal [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 2:58 PM
To: [EMAIL PROTECTED]
Subject: any help with select query??


I have table one and table two

     I want to show all records from table one
     but also check if in table two is record that are in table one so
if 
this is ture then
     bla=1 if false then bla=2 is it possible?

query-"select tableone.user,tabletwo.user from tableone,tabletwo 
tableone.user=tabletwo.user"
it will only show records if I have same users in these tables but I
need to show everyone from table one if in tableone user match with
tabletwo then blabla=1 and so on ??

any hint



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to