Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NOT in SQL
Message
De
26/07/2001 01:34:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
NOT in SQL
Divers
Thread ID:
00535535
Message ID:
00535535
Vues:
44
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...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform