Questions on 'datetime' parameters

Поиск
Список
Период
Сортировка
От Dave_Pfaltzgraff@patapsco.com
Тема Questions on 'datetime' parameters
Дата
Msg-id 852569E3.0054B5F2.00@patapsco.com
обсуждение исходный текст
Список pgsql-novice



Dave Pfaltzgraff@PATAPSCO
01/29/2001 10:25 AM

I have a table defined as:

Table    = associate
+---------------------+----------------------------------+-------+
|        Field        |              Type                | Length|
+---------------------+----------------------------------+-------+
| as_id               | int4 not null                    |     4 |
| as_card             | char()                           |    10 |
| as_end              | datetime default ( now ( ) + 31 )|     8 |
+---------------------+----------------------------------+-------+

and would like to select entries where as_end is prior to the current
time. Which of the following would be the correct SQL statement?

SELECT AS_Card, AS_ID INTO ntemp FROM Associate WHERE AS_End < time('now');

or:

SELECT AS_Card, AS_ID INTO ntemp FROM Associate WHERE AS_End < 'now';

or, is there another form better... like maybe 'now'::datetime ...?

Thanks,
Dave



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

Предыдущее
От: Herb Pabst
Дата:
Сообщение: Re: Still lockin up...
Следующее
От: Eric Frazier
Дата:
Сообщение: DatabaseMetaData - getTables and weird data types