Common SQL Errors

MySQL Error 1353: ER_VIEW_WRONG_LIST - Fix, Causes, and Prevention

Galaxy Team
August 6, 2025

<p>The column list given in a CREATE or ALTER VIEW statement does not match the number of columns produced by its SELECT clause.</p>

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error code 1353?

<p>MySQL Error 1353: ER_VIEW_WRONG_LIST occurs when the column list in a CREATE or ALTER VIEW statement has a different count than the SELECT clause. Align the view's explicit column list with the exact number of columns returned by the SELECT to resolve the error.</p>

Error Highlights

Typical Error Message

View's SELECT and view's field list have different column

Error Type

Schema Definition Error

Language

MySQL

Symbol

ER_VIEW_WRONG_LIST

Error Code

1353

SQL State

HY000

Explanation

Table of Contents

What is MySQL Error 1353: ER_VIEW_WRONG_LIST?

MySQL raises Error 1353 - ER_VIEW_WRONG_LIST when a CREATE VIEW or ALTER VIEW statement supplies an explicit column list that differs in count from the columns produced by its SELECT clause. The database engine validates both lists during view compilation and stops execution if the counts disagree.

The issue can involve either too many names in the column list or too few columns selected. Because views act like virtual tables, this mismatch would break downstream queries that rely on a stable column schema.

When does ER_VIEW_WRONG_LIST occur?

The error appears at compile time of a CREATE VIEW, CREATE OR REPLACE VIEW, or ALTER VIEW statement. It is version-agnostic and occurs in MySQL 5.x, 8.x, and compatible MariaDB releases.

Developers often see it after adding or removing expressions in the SELECT clause without updating the optional column list, or when copying view definitions between environments with slight schema differences.

Why is it important to fix?

Leaving the view in an invalid state blocks deployment pipelines and prevents applications from running migrations. Users cannot query or refresh the view until the definition is corrected, risking service downtime or inconsistent reporting.

Promptly fixing the mismatch keeps database schemas consistent and avoids cascading errors in stored procedures, ORMs, and BI tools that reference the view.

What Causes This Error?

The primary cause is a count mismatch between the explicit column list and the SELECT list. Secondary factors include forgotten wildcard expansion, conditional SELECT logic inside UNIONs, and accidental duplicate column names that MySQL rewrites or removes.

How to Fix MySQL Error 1353: ER_VIEW_WRONG_LIST

Align the number of column aliases with the number of expressions returned by the SELECT statement. The fix usually involves one of three actions: add missing column aliases, remove extra aliases, or adjust the SELECT list to match.

Common Scenarios and Solutions

Developers frequently run into the error after adding a new calculated column to a view for analytics, or when cleaning up unused columns. Reviewing the view definition with SHOW CREATE VIEW and comparing the alias list to the SELECT clause quickly highlights mismatches.

Best Practices to Avoid This Error

Always omit the optional column list unless you need to rename columns. Prefer explicit aliasing inside the SELECT clause. Incorporate automated schema reviews in CI pipelines to catch mismatches before they reach production. Galaxy's SQL editor surfaces column counts and warnings in real time, helping you spot issues early.

Related Errors and Solutions

Similar view-related errors include ER_VIEW_SELECT_CLAUSE (1291), ER_VIEW_SELECT_VARIABLE (1351), and ER_ALTER_VIEW_NO_CHANGE (1367). Each involves view definition problems but differs in root cause and resolution steps.

Common Causes

Extra column names in the view definition

Providing more aliases than SELECT expressions triggers the mismatch.

Missing column names in the view definition

Supplying fewer aliases than expressions leaves unnamed columns, causing the error.

Wildcard expansion (* or tbl.*)

Using a wildcard can expand to additional columns that exceed the alias list.

Conditional UNION branches

Different SELECT branches in a UNION may return varying column counts, confusing the alias list.

Related Errors

MySQL Error 1291: ER_VIEW_SELECT_CLAUSE

Occurs when a view's SELECT contains disallowed constructs.

MySQL Error 1351: ER_VIEW_SELECT_VARIABLE

Raised when a SELECT list references variables not allowed in views.

MySQL Error 1367: ER_ALTER_VIEW_NO_CHANGE

Triggered when ALTER VIEW makes no effective change to the definition.

FAQs

Does the view column list have to be specified?

No. If you omit it, MySQL names columns using the aliases in the SELECT clause, reducing mismatch risk.

Does wildcard * always cause ER_VIEW_WRONG_LIST?

Not always, but it can if the expanded columns outnumber your alias list.

Can I fix the error without dropping the view?

Yes. Use CREATE OR REPLACE VIEW or ALTER VIEW with a corrected definition.

How does Galaxy help prevent this error?

Galaxy’s editor counts SELECT columns in real time and warns when the alias list does not match, preventing the mismatch before execution.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo