Re: Stupid SQL Question:

Поиск
Список
Период
Сортировка
От Jonathan Ellis
Тема Re: Stupid SQL Question:
Дата
Msg-id 01c101c04e9d$e124ef20$0d00a8c0@dsl.inconnect.com
обсуждение исходный текст
Ответ на Stupid SQL Question:  (shawn everett <everett@pgweb.com>)
Список 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 по дате отправления:

Предыдущее
От: "Valter Mazzola"
Дата:
Сообщение: eRserver.com Replication Server beta not available !?
Следующее
От: Michael Fork
Дата:
Сообщение: Re: Stupid SQL Question: