Simon Parker
Simon Parker

Reputation: 1834

How do I see what a MySQL view is made of?

I'm sure this is easy to do, but I can't find how to do it! How do I see what a view in MySQL is made of? Basically, how do I see what statements were used in the original CREATE VIEW?

Upvotes: 3

Views: 119

Answers (2)

rtd1123
rtd1123

Reputation: 500

I would suggest something like this:

SHOW CREATE VIEW

Upvotes: 1

Michael Berkowski
Michael Berkowski

Reputation: 270599

See the documents on SHOW CREATE VIEW

SHOW CREATE VIEW viewname;

And actually, I usually use \G to suppress tabular output for easier reading:

SHOW CREATE VIEW viewname\G

Upvotes: 5

Related Questions