Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NOT in SQL
Message
From
26/07/2001 01:34:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
NOT in SQL
Miscellaneous
Thread ID:
00535535
Message ID:
00535535
Views:
45
Hi,
I have a cursor called cursorA which is query from tableA. Now, I need to get the records from tableA which doesn't match the records collected in cusrorA with 2 conditions. I have try couples of way to do so such as, #, <>, !=, NOT (... == ...), or even NOT IN (...) AND NOT IN(...). All of these doesn't return correct result. any ideas?
Example 1

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

Example 2
Select s.usize, s.uname, s.ppu, s.gcode, s.ccode, s.Ino, s.BCode, s.IName, s.loccode, s.CPU, s.qty, (s.CPU * s.qty) AS TotalCost ;
FROM tempStock1 s, csrLPQty l ;
WHERE (s.Ino <> l.INo AND s.LocCode <> l.LocCode) ;
UNION ;
SELECT usize, uname, ppu, gcode, ccode, Ino, BCode, IName, loccode, CPU, qty, (CPU * qty) AS TotalCost ;
FROM csrLPQty ;
into cursor tempStock
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Next
Reply
Map
View

Click here to load this message in the networking platform