CREATE TABLE new_table LIKE original_table;
CREATE TABLE new_table LIKE original_table;
INSERT INTO new_table SELECT * FROM original_table;
Multiple field=
SELECT username, email, COUNT(*)
FROM users
GROUP BY username, email
HAVING COUNT(*) > 1
Single field=
SELECT _column, COUNT(*)
FROM _table
GROUP BY _column
HAVING COUNT(*) > 1
• SELECT first_name, COUNT (first_name) FROM employees
GROUP BY first_name
HAVING (COUNT(first_name) > 1);
SELECT *
INTO NewTableName
FROM OriginalTable;
ALTER TABLE Table1
ADD SubCategory2 {Type of subcategory 1} {NULL|NOT NULL}
UPDATE Table1 SET SubCategory2 = SubCategory;