> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/server-usage/views/alter-view.md).

# ALTER VIEW

## Syntax

```bnf
ALTER
    [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
    [DEFINER = { user | CURRENT_USER }]
    [SQL SECURITY { DEFINER | INVOKER }]
    VIEW view_name [(column_list)]
    AS select_statement
    [WITH [CASCADED | LOCAL] CHECK OPTION]
```

## Description

This statement changes the definition of a [view](/docs/server/server-usage/views.md), which must exist. The syntax is similar to that for [CREATE VIEW](/docs/server/server-usage/views/create-view.md) and the effect is the same as for `CREATE OR REPLACE VIEW` if the view exists. This statement requires the `CREATE VIEW` and `DROP` [privileges](/docs/server/reference/sql-statements/account-management-sql-statements/grant.md#table-privileges) for the view, and some privilege for each column referred to in the `SELECT` statement. `ALTER VIEW` is allowed only to the definer or users with the [SUPER](/docs/server/reference/sql-statements/account-management-sql-statements/grant.md#global-privileges) privilege.

## Example

```sql
ALTER VIEW v AS SELECT a, a*3 AS a2 FROM t;
```

## See Also

* [CREATE VIEW](/docs/server/server-usage/views/create-view.md)
* [DROP VIEW](/docs/server/server-usage/views/drop-view.md)
* [SHOW CREATE VIEW](/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-view.md)
* [INFORMATION SCHEMA VIEWS Table](/docs/server/server-usage/views/information-schema-views-table.md)

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/server-usage/views/alter-view.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
