I have two tables... APPLICANTS and DEALS.There can be multiple deals per
applicant but only one applicant per deal.
SELECT COMPANY_ID, COUNT(APPLICANT_ID)
FROM APPLICANTS
GROUP BY COMPANY_ID
Results:
1 3
2 9
3 7
SELECT COMPANY_ID, COUNT(DEAL_ID)
FROM DEALS
GROUP BY COMPANY_ID
Results:
1 3
2
, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:11 PM
To: CF-Talk
Subject: SQL Puzzle?
I have two tables... APPLICANTS and DEALS.There can be multiple deals per
applicant but only
Does this work?
SELECT A.COMPANY_ID, A.COUNT(APPLICANT_ID),B.COUNT(DEAL_ID)
FROM APPLICANTS A, DEALS B
WHERE A.COMPANY_ID = B.COMPANY_ID
GROUP BY A.COMPANY_ID
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
You might need to you the AS
SELECT A.COMPANY_ID, A.COUNT(APPLICANT_ID) AS APPCOUNT,B.COUNT(DEAL_ID) AS
DEALCOUNT
FROM APPLICANTS A, DEALS B
WHERE A.COMPANY_ID = B.COMPANY_ID
GROUP BY A.COMPANY_ID
CC
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
Down here
tHE First query result is 267
tHE Second query result is 211
The Thirth and four query result is empty.
My question is whyy???
Thanks friends in advance and forgive my desperate state.
regards Mario
// First Query
SELECT
Down here
tHE First query result is 267
tHE Second query result is 211
The Thirth and four query result is empty.
My question is whyy???
Thanks friends in advance and forgive my desperate state.
regards Mario
Breaking this down
The first returns more than the
Philip:
Your valid help has been well appreciated.
I solved my problem with your suggestion
Thanks a thousand friend
Regards Mario
- Original Message -
From: Philip Arnold - ASP [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, May 22, 2002 1:40 PM
Subject: RE: SQL puzzle
7 matches
Mail list logo