Subject | Re: [firebird-support] Need help with unexpected results from a query |
---|---|
Author | Alexandre Benson Smith |
Post date | 2004-03-12T01:07:47Z |
At 21:57 11/03/2004 -0300, you wrote:
In fact this query should be:
SELECT
ZIPCODE_ANALYSIS.ACTIVITY_NAME AS ActivityName,
ZIPCODE_ANALYSIS.ZIP AS CustomerZip,
COUNT(ZIPCODE_ANALYSIS.C_ID) AS CountCID
FROM ZIPCODE_ANALYSIS
where
(ZIPCODE_ANALYSIS.ACTIVITY_DATE BETWEEN '02/01/2004' AND '02/29/2004')
GROUP BY
ZIPCODE_ANALYSIS.ACTIVITY_NAME,
ZIPCODE_ANALYSIS.ZIP
ORDER BY 1
the where clause must be prior to the group by... sorry I have just
replaced the keyword...
See you !
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
----------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.596 / Virus Database: 379 - Release Date: 26/02/2004
[Non-text portions of this message have been removed]
>SELECTSorry,
> ZIPCODE_ANALYSIS.ACTIVITY_NAME AS ActivityName,
> ZIPCODE_ANALYSIS.ZIP AS CustomerZip,
> COUNT(ZIPCODE_ANALYSIS.C_ID) AS CountCID
>FROM ZIPCODE_ANALYSIS
>GROUP BY
> ZIPCODE_ANALYSIS.ACTIVITY_NAME,
> ZIPCODE_ANALYSIS.ZIP
>where
> (ZIPCODE_ANALYSIS.ACTIVITY_DATE BETWEEN '02/01/2004' AND '02/29/2004')
>ORDER BY 1
In fact this query should be:
SELECT
ZIPCODE_ANALYSIS.ACTIVITY_NAME AS ActivityName,
ZIPCODE_ANALYSIS.ZIP AS CustomerZip,
COUNT(ZIPCODE_ANALYSIS.C_ID) AS CountCID
FROM ZIPCODE_ANALYSIS
where
(ZIPCODE_ANALYSIS.ACTIVITY_DATE BETWEEN '02/01/2004' AND '02/29/2004')
GROUP BY
ZIPCODE_ANALYSIS.ACTIVITY_NAME,
ZIPCODE_ANALYSIS.ZIP
ORDER BY 1
the where clause must be prior to the group by... sorry I have just
replaced the keyword...
See you !
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
----------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.596 / Virus Database: 379 - Release Date: 26/02/2004
[Non-text portions of this message have been removed]