Re: Reconcilliation
From: Roji. P. Thomas (lazydragon_at_nowhere.com)
Date: 03/02/04
- Next message: Russ: "Executing sql"
- Previous message: Uri Dimant: "Re: Reconcilliation"
- In reply to: Peter Newman: "Reconcilliation"
- Next in thread: Vishal Parkar: "Re: Reconcilliation"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Mar 2004 18:14:50 +0530
Assuming that your client table has one to one realtionship with other
tables doing a left outer join will give u the result
here is an example from pubs.
SELECT j.job_id,
CASE WHEN e.job_Id IS NULL THEN 'NO' ELSe 'YES' END
FROM jobs j
LEFT OUTER JOIN employee e
on j.job_Id = e.job_id
-- Roji. P. Thomas SQL Server Programmer "Peter Newman" <anonymous@discussions.microsoft.com> wrote in message news:EDFD3406-B0B2-4CEE-91B0-0BE05D6FE94F@microsoft.com... > I have severay tables all linked by a Client_Ref Field. Im need to find out if any of the tables are missing records for any of the clients > > TAdmin > Client_Ref VARCHAR(6) > CompanyName VARCHAR(25) > > TComms > Client_Ref VARCHAR(6) > > TAccounts > Client_Ref VARCHAR(6) > > TFees > Client_Ref VARCHAR(6) > > TUsers > Client_Ref VARCHAR(6) > > > Im trying to get a result to show any clients that do NOT have a record in all tables > > > Client_Ref CompanyName TAdmin TComms TAccounts TFees TUsers > 121212 Test Company 1 YES NO YES YES NO > 225225 Test Company 2 NO NO NO YES NO > > Can anybody help?
- Next message: Russ: "Executing sql"
- Previous message: Uri Dimant: "Re: Reconcilliation"
- In reply to: Peter Newman: "Reconcilliation"
- Next in thread: Vishal Parkar: "Re: Reconcilliation"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|