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
 Development Tools
 ASP.NET
 How to compare records with cursors

Author  Topic 

Swati Jain
Posting Yak Master

139 Posts

Posted - 2007-06-19 : 05:42:10
Table1
QtyOnOrder QtyOnHand OrderNo


Table2
QtyOnHand OrderNo


I want to compare 'QtyOnhand' column with both tables(using cursors)

as a result i want to set the column 'flag' with boolen values

How to write query with this?





dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-06-19 : 11:28:46
You probably dont need a cursor. Do a join on the tables joining on both ORderNo as well as QtyOnHand.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -