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

         

Операции с интервалами



Листинг 3.27. Операции с интервалами booktown=# SELECT date('1980-06-25');


date

1980-06-25

(1 row)

booktown=# SELECT interval С 21 years 8 days');

interval

21 years 8 days (1 row)

booktown=# SELECT date('1980-06-25') + interval

('21 years 8 days') booktown-# AS spanned_date:

spanned_date

2001-07-03 00:00:00-07

(1 row)

booktown=# SELECT date ('1980-06-25') -

interval ('21 years 8 days ago1)

booktown-# AS twice_inverted_interval_date;

twice_ nverted_interval_date

2001-07-03 00:00:00-07

(1 row)



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