Paul
You caught me out!
I had simplified what I really wanted to achieve - not expecting the solution to be recast into the new SQL format (which I just don't seem to be able to follow)
 
What I really wanted to do was this (in pseudocode)
 
Delete from SaleREF s
where (s.CustCode, s.DestCode) not in
(select distinct (CustCode, DestCode) from CustDest)
 
I'm sorry but I can't pick how I need to change your code to achieve this.
 
Mark
 
 
----- Original Message -----
Sent: Sunday, May 13, 2001 9:11 PM
Subject: RE: [DUG-DB]: SQL poser

You could use a JOIN?  eg
 
SELECT s.CustCode, s.DestCode, COUNT(*)
    FROM SaleREF s JOIN CustDest d
        ON s.CustCode=d.CustCode and s.DestCode=d.DestCode
GROUP BY s.CustCode, s.DestCode
 
 
Paul Ritchie
Radio Computing Services.
 
-----Original Message-----
From: Mark Howard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 10:06 AM
To: Multiple recipients of list database
Subject: [DUG-DB]: SQL poser

Hi all
 
I want to do the following: (in Paradox 7)
 
Select count(*) from SaleREF sr
where (sr.CustCode, sr.DestCode) in
(select distinct (CustCode, DestCode)  from CustDest)
 
ie I want to count the number of times that a CustCode/DestCode pairing that appears in the CustDest table also appears in the SaleREF table.
 
How can I do this, please?
 
Mark
 
 

Reply via email to