SQLсервер в Linux -самостоятельное освоение пакета

       

Сравнение констант now и current



Листинг 3.29. Сравнение констант now и current

booktown=# INSERT INTO shipments (customer_id. isbn, ship_date)

Ccustomer_id, isbn, ship_date)

booktown-# VALUES (1. '039480001X', 'current');

INSERT 3391221 1

booktown=# INSERT INTO shipments (customer_id. isbn, ship_date)

booktown-# VALUES (2. '0394800753'. 'now');

INSERT 3391222 1

booktown=# SELECT isbn. ship_date FROM shipments: isbn | ship_date

039480001X [ current 0394800753 | 2001-08-10 18:17:49-07

(2 rows)

booktown=# SELECT isbn.

booktown-# to_char(ship_date. 'YYYY-MM-DD HH24:MI:SS')



booktown-# AS value

booktown-# FROM shipments; isbn value

039480001X | 2001-08-10 18:21:22 0394800753 | 2001-08-10 18:17:49

(2 rows)

booktown=# SELECT isbn.

booktown-# to_char(ship_date. 'YYYY-MM-DD HH24:MI:SS')

booktown-# AS value

booktown-# FROM shipments;

isbn | value

039480001X | 2001-08-10 18:22:35 0394800753 | 2001-08-10 18:17:49

(2 rows)



Содержание раздела