Using the INTERVAL YEAR TO MONTH Type
SQL>
SQL> -- Using the INTERVAL YEAR TO MONTH Type
SQL>
SQL> -- INTERVAL YEAR TO MONTH type to store time intervals measured in years and months.
SQL>
SQL> CREATE TABLE coupons (
2 coupon_id INTEGER,
3 name VARCHAR2(30),
4 duration INTERVAL YEAR(3) TO MONTH
5 );
Table created.
SQL>
SQL> desc coupons;
Name Null? Type
----------------------------------------------------------------------------------------------------- -------- --------------------
COUPON_ID NUMBER(38)
NAME VARCHAR2(30)
DURATION INTERVAL YEAR(3) TO MONTH
SQL>
SQL> drop table coupons;
Related examples in the same category