Skip to content

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.

What Triggers Error 1060?

Common Scenarios

  • Creating or Modifying Tables: When attempting to create a new table or modify an existing one with columns sharing the same name.
  • Join Queries: When using JOIN operations without aliases, leading to ambiguity if the joined tables have columns with identical names.

Code Example

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.

Identifying the Duplicate Column

Inspect Table Structure

Use the DESCRIBE statement to examine the structure of your tables.

DESCRIBE your_table_name;

Analyze Query

Review JOIN queries for overlapping column names. If tables share column names, use aliases to differentiate them.

Resolving the Error

Renaming Columns

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;

Aliasing in Queries

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

Robert Cooper avatar

Robert Cooper

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.

View full author profile →

Looking for an AI-native BI tool?

Basedash lets you build charts, dashboards, and reports in seconds using all your data.