SQL Puzzle?

2003-10-07 Thread cf-talk
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

RE: SQL Puzzle?

2003-10-07 Thread Tony Weeg
, 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

Re: SQL Puzzle?

2003-10-07 Thread Casey C Cook
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]

Re: SQL Puzzle?

2003-10-07 Thread Casey C Cook
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]

SQL puzzle

2002-05-22 Thread Mario Martinez
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

RE: SQL puzzle

2002-05-22 Thread Philip Arnold - ASP
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

Re: SQL puzzle

2002-05-22 Thread Mario Martinez
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