sum gives different answer

Поиск
Список
Период
Сортировка
От Chairudin Sentosa
Тема sum gives different answer
Дата
Msg-id 36E9076C.2850C00@prima.net.id
обсуждение исходный текст
Список pgsql-sql
Hi all,

I have two SQL statements that I expect to give (0 rows) as output.
However the first one with 'sum' does not do that.
Why the first SQL statement gives (1 row) and empty?
While the second SQL statement can give (0 row).
I am using postgresql 6.4.2.

First
------
select pin, sum(duration) from tablename where date(start_time)=
(select date 'today') group by pin;

pin|sum
---+---
   |
(1 row)


Second
------
select pin, duration from tablename where date(start_time)=
(select date 'today') group by pin;

pin|duration
---+--------
(0 rows)

Could anyone tell me why, please?

Regards
Chai


В списке pgsql-sql по дате отправления:

Предыдущее
От: Chairudin Sentosa
Дата:
Сообщение: sum gives different answer
Следующее
От: Chairudin Sentosa
Дата:
Сообщение: sum gives different answer