Using the INTERVAL YEAR TO MONTH Type : INTERVAL « Date Timezone « Oracle PL / SQL






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

1.INTERVAL YEAR(3) TO MONTH
2.INTERVAL DAY TO SECOND type to store time intervals measured in days and seconds
3.INTERVAL DAY(3) TO SECOND (4)
4.INTERVAL DAY TO SECOND
5.Use date time Interval type: interval day(1) to second(2)