Re: Stupid SQL Question: - Mailing list pgsql-general

From Jonathan Ellis
Subject Re: Stupid SQL Question:
Date
Msg-id 01c101c04e9d$e124ef20$0d00a8c0@dsl.inconnect.com
Whole thread Raw
In response to Stupid SQL Question:  (shawn everett <everett@pgweb.com>)
List pgsql-general
> Adding a WHERE clause to the query doesn't work for example:
>
> SELECT outcome,count(outcome) from safety
> GROUP BY outcome
> WHERE InjDate='2000-11'14';

A WHERE clause must come before a GROUP BY clause.

Also note that if you are using a table with the row defined as datetime
instead of date, you will need something like
WHERE InjDate > '2000-11-14' and InjDate < '2000-11-15'
since unless you specify minutes and seconds, a datetime will assume you
mean 0:00.

-Jonathan


pgsql-general by date:

Previous
From: "Valter Mazzola"
Date:
Subject: eRserver.com Replication Server beta not available !?
Next
From: Michael Fork
Date:
Subject: Re: Stupid SQL Question: