SQL Views Question

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Quick question on MySQL Views...

Once a view is created, is there a way to retrieve the SQL behind it at a later date in case I want to alter it?

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

Yup: SHOW CREATE VIEW
SHOW CREATE VIEW `ViewName`

Never used it myself. I use the old MySQL GUI tools, but I tested the SQL and it works.

They have: 9 posts

Joined: May 2013

Well, SQL (Structured Query Language) is a way to request something from a database. It's not a programming language, but more of a requesting language.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

That works. I know I'm going to create a view and then forget what the heck I did later on or must tweak it slightly w/o having to recall it.

Thanks Smiling

They have: 12 posts

Joined: Apr 2013

ALTER VIEW myView (id,first_name,city)
-> AS SELECT id, upper(first_name), city FROM employee;

They have: 3 posts

Joined: Aug 2010

hi,

I also use the old MySQL GUI tools, but I tested the SQL and it works or not.

They have: 5 posts

Joined: Apr 2011

Of course !!

jessicaellen's picture

They have: 31 posts

Joined: Nov 2010

Yes my dear you can alter view. Here is the query for alter a view.
ALTER VIEW myView (id,first_name,city)
-> AS SELECT id, upper(first_name), city FROM employee;
Query OK, 0 rows affected (0.00 sec)

zani's picture

He has: 2 posts

Joined: May 2011

tell me friend
login join date show after login (sql query)

They have: 26 posts

Joined: May 2012

Well, SQL (Structured Query Language) is a way to request something from a database. It's not a programming language, but more of a requesting language.

They have: 15 posts

Joined: Dec 2012

thanks for the help !!

They have: 11 posts

Joined: Apr 2013

view is the virtual table which is create by admin for the different diiferent users to access the information

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.