Are You a phpMyAdmin user? If so have you created views in it? I think most of you are. But phpMyAdmin doesn’t have a direct way to edit the views.
So what we do? Here is the easy steps to edit the MySQL-views in phpMyAdmin.This solution is just re-shared from the stackoverflow
Let our view name be “MySampleView”. Don’t forget to substitute your view name where ever you see “MySampleView”. 😉
- Run the Query
SHOW CREATE VIEW
- Click on the options just above the query result and change partial text to full text.
- Copy the content of create view column after “SQL SECURITY DEFINER VIEW `MySampleView` AS” and paste it in a query editor
- Make the changes you need for the view and run it.(Hope your desired output has came)
- Now Scroll until you see create view after the query result and click on it
- You will be taken into the create view page.There you give your old view name ie.,MySampleView in the VIEW name field and check in the OR REPLACE field.
- I hope the As textarea will be filled with your edited query if not please paste your new edited query
- Press GO to update the view.
Hooray. You have done it.