ALTER TABLE table_name ADD CONSTRAINT cst_name UNIQUE (col_name);
ALTER TABLE table_name ADD CONSTRAINT cst_name UNIQUE (col1, col2); -- Multiple
ALTER TABLE table_name ADD col_name NUMBER UNIQUE; -- New field
SELECT DISTINCT column_1
FROM table;
Code language: SQL (Structured Query Language) (sql)
SELECT
DISTINCT product_id,
quantity
FROM
ORDER_ITEMS
ORDER BY
product_id;
Code language: SQL (Structured Query Language) (sql)