Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NOT in SQL
Message
From
26/07/2001 05:24:40
 
 
To
26/07/2001 01:34:20
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00535535
Message ID:
00535571
Views:
12
Hi John,

>>Select s.usize, s.uname, s.ppu, s.gcode, s.ccode, s.Ino, s.BCode, s.IName, .loccode, s.CPU, s.qty, (s.CPU * s.qty) AS TotalCost ;
FROM tempStock1 s ;
WHERE NOT s.Ino IN (SELECT Ino FROM csrLPQty) and ;
NOT (s.loccode in (select loccode from csrLPQty))) ;
UNION ;
SELECT usize, uname, ppu, gcode, ccode, Ino, BCode, IName, loccode, CPU, qty, (CPU * qty) AS TotalCost ;
FROM csrLPQty ;
into cursor tempStock<<

This will give you the result where s.ino and s.loccode each in isolation to each other do not have correponding records in csrLPQty

Try using the criteria

WHERE NOT EXISTS (SELECT * FROM csrLPQty B WHERE S.ino = b.ino AND s.loccode = b.loccode)

Simon Horne
Previous
Reply
Map
View

Click here to load this message in the networking platform