On 7/3/07, Kevin Esteb <[EMAIL PROTECTED]> wrote:

How would I format the following query?

select to_char(datetime,'YYYY-MM-DD') as date,url,sum(number_requests)
from request group by date,url order by date,url;

I have tried several different iterations, but the "as date" seems to
trip me up.


No doubt.  I'd surmise that you'd need to do some quoting to use the word
"date",
which is almost certainly a reserved word in every RDBMS I've ever seen.

So I'd look for a better column name.

Also, it's likely that the act of grouping your results for summing is going
to have
the side effect of sorting them.

Len.
--
[EMAIL PROTECTED]
614-404-4214
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/dbix-class@lists.rawmode.org/

Reply via email to