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 2005 Forums
 Transact-SQL (2005)
 compare columns of two table

Author  Topic 

scottichrosaviakosmos
Yak Posting Veteran

66 Posts

Posted - 2010-07-30 : 05:14:57

SELECT tbl26.recieptno as reciept26, tbl26.covernote as covernote26, tbl28.recieptno as recieptno28,tbl28.covernote as covernote28
FROM tbl26 JOIN tbl28 on tbl26.recieptno=tbl28.recieptno
WHERE (tbl26.covernote not LIKE tbl28.covernote ) order by 1 desc

i want the rows which r different covernote from each other on same recieptno.

both tables have 65 thousand rows but resultset of this query i m getting 4 lack rows

scoo

Sachin.Nand

2937 Posts

Posted - 2010-07-30 : 05:22:21
SELECT tbl26.recieptno as reciept26, tbl26.covernote as covernote26, tbl28.recieptno as recieptno28,tbl28.covernote as covernote28
FROM tbl26 JOIN tbl28 on tbl26.recieptno=tbl28.recieptno
WHERE (tbl26.covernote<>tbl28.covernote ) order by 1 desc



Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page
   

- Advertisement -