Ford, Mike wrote:
-----Original Message-----
From: Govinda [mailto:govinda.webdnat...@gmail.com]
Sent: 05 August 2009 01:41

Taking this:
SELECT count(*) AS
`CountUniqueDatesInMyTbl`, date(solarAWDateTime) AS `uniqueDate`,
'aweber_7solar_aw' AS `tableAlias` FROM aweber_7solar_aw GROUP BY
DATE(solarAWDateTime)

Just one other tiny point of style here: having given the expression 
date(solarAWDateTime) the alias uniqueDate, you should probably use that alias 
to refer to the same thing elsewhere in your query, such as in the GROUP BY 
column.  So:

SELECT count(*) AS `CountUniqueDatesInMyTbl`,
       date(solarAWDateTime) AS `uniqueDate`,
       'aweber_7solar_aw' AS `tableAlias`
   FROM aweber_7solar_aw
   GROUP BY `uniqueDate`;

That's a mysqlism :( It's not portable to other db's (apparently it's not part of the sql-spec).

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to