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)
 compare

Author  Topic 

olocin
Starting Member

9 Posts

Posted - 2007-04-20 : 03:53:01
hello everyone,

I need help on query, i need to compare two columns from different tables. I was able to compare them but the problem is i need to just display the results or output of 1 table

ex.
table1.field1
a
b
c
d
e
table2.field2
a
b
f
g
h

the results i need to display is "C,D,E" of table1. how can i do this? Any help is greatly appreciated

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-20 : 04:40:12
[code]
select t1.field1
from table1 t1 left join table2 t2
on t1.field1 = t2.field2
where t2.field2 is null
[/code]


KH

Go to Top of Page

olocin
Starting Member

9 Posts

Posted - 2007-04-20 : 05:25:18
ILL TRY IT LATER WHEN I GET HOME. THANKS IN ADVANCE
Go to Top of Page
   

- Advertisement -