Duplicate Column Name in MySQL
Robert Cooper
Robert Cooper Senior Engineer at Basedash
· January 31, 2025
Robert Cooper
Robert Cooper Senior Engineer at Basedash
· January 31, 2025
In MySQL, “Error 1060: Duplicate column name” means there’s a conflict where a column name is being used more than once within a table, or in a query with JOINs or aliases. In this guide we’ll explain how to identify and resolve the issue.
CREATE TABLE users (
id INT,
name VARCHAR(50),
id INT
);
In this example, attempting to create a table with two id columns triggers Error 1060.
Use the DESCRIBE statement to examine the structure of your tables.
DESCRIBE your_table_name;
Review JOIN queries for overlapping column names. If tables share column names, use aliases to differentiate them.
If a table is incorrectly designed with duplicate column names, use the ALTER TABLE statement to rename the offending columns.
ALTER TABLE your_table_name CHANGE old_column_name new_column_name DATATYPE;
For JOIN queries, aliasing will help resolve name conflicts.
SELECT t1.id as t1_id, t2.id as t2_id
FROM table1 t1
JOIN table2 t2 ON t1.foreign_key = t2.id;
For day-to-day data operations, Basedash helps teams move from one-off SQL to AI-native BI workflows by pairing governed query generation with collaborative dashboards and consistent reporting.
Written by
Senior Engineer at Basedash
Robert Cooper is a senior engineer at Basedash who builds full-stack product systems across SQL data infrastructure, APIs, and frontend architecture. His work focuses on application performance, developer velocity, and reliable self-hosted workflows that make data operations easier for teams at scale.
Basedash lets you build charts, dashboards, and reports in seconds using all your data.