SELECT SPECIFIC COLUMNS : INSERT Column Name « Insert Delete Update « Oracle PL / SQL






SELECT SPECIFIC COLUMNS

 
SQL>
SQL> CREATE TABLE purchase (
  2       product_name  VARCHAR2(25) NOT NULL,
  3       product_price NUMBER(4,2)  NOT NULL,
  4       purchase_date DATE
  5       );

Table created.

SQL>
SQL>
SQL> INSERT INTO purchase (product_name, product_price) VALUES ('Product Name 2', 2.5);

1 row created.

SQL> INSERT INTO purchase (product_name, product_price) VALUES ('Product Name 3', 50.75);

1 row created.

SQL> INSERT INTO purchase (product_price, product_name) VALUES (99.99, 'Product Name 4');

1 row created.

SQL>
SQL>
SQL> SELECT product_name FROM purchase;

PRODUCT_NAME
-------------------------
Product Name 2
Product Name 3
Product Name 4

3 rows selected.

SQL>
SQL> SELECT product_name, purchase_date FROM purchase;

PRODUCT_NAME              PURCHASE_
------------------------- ---------
Product Name 2
Product Name 3
Product Name 4

3 rows selected.

SQL>
SQL>
SQL> drop table purchase;

Table dropped.

SQL>

 








Related examples in the same category

1.Using the column list in INSERT command, include a column list after the table name.
2.The order of values in the VALUES clause matches the order in which the columns are specified in the column list
3.Specifying a Null Value for a Column
4.Including Double Quotes in a Column Value
5.INSERTING DATA CONTAINING APOSTROPHES
6.Changing column order
7.Use quotation in insert statement in PL/SQL