Re: Stupid SQL Question:

From: "Jonathan Ellis" <jellis(at)advocast(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Stupid SQL Question:
Date: 2000-11-15 00:47:55
Message-ID: 01c101c04e9d$e124ef20$0d00a8c0@dsl.inconnect.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fork 2000-11-15 00:49:18 Re: Stupid SQL Question:
Previous Message shawn everett 2000-11-15 00:18:39 Stupid SQL Question: