select query doubt
-
hi frndz, I am using MSSQL 2000 I have 2 tables Tbl1 ID Name 1 AAA 2 BBB 3 CCC 4 DDD Tbl2 ID parentid 1 0 2 0 I need to select the values in tbl1 and not in tbl2 ie ID NAme 3 CCC 4 DDD how it possible??
All I ever wanted is what others have....
CrazySanker -
hi frndz, I am using MSSQL 2000 I have 2 tables Tbl1 ID Name 1 AAA 2 BBB 3 CCC 4 DDD Tbl2 ID parentid 1 0 2 0 I need to select the values in tbl1 and not in tbl2 ie ID NAme 3 CCC 4 DDD how it possible??
All I ever wanted is what others have....
CrazySanker -
hi frndz, I am using MSSQL 2000 I have 2 tables Tbl1 ID Name 1 AAA 2 BBB 3 CCC 4 DDD Tbl2 ID parentid 1 0 2 0 I need to select the values in tbl1 and not in tbl2 ie ID NAme 3 CCC 4 DDD how it possible??
All I ever wanted is what others have....
CrazySankerselect * from Tbl1 where Tbl1.ID not in (select ID from Tbl2)
orselect t1.* from Tbl1 t1 left join Tbl2 t2 on t1.ID = t2.ID where t2.ID is null
-- modified at 10:54 Monday 22nd October, 2007You always pass failure on the way to success.