如何使用 phpMyAdmin 3.2.4 编辑视图?
我需要在 phpMyAdmin 3.2.4 中简单地编辑一个非常复杂的视图,但我不知道如何做到这一点.有什么建议?谢谢!
I need to simply edit a very complicated view in phpMyAdmin 3.2.4 but I cannot figure how to do that. Any suggestions? Thanks!
推荐答案
为了扩展 CheeseConQueso 所说的内容,以下是使用 PHPMyAdmin 更新视图的整个步骤:
To expand one what CheeseConQueso is saying, here are the entire steps to update a view using PHPMyAdmin:
- 运行以下查询:
SHOW CREATE VIEW your_view_name
- 展开选项并选择全文
- 按Go
- 复制创建视图列的全部内容.
- 在您选择的编辑器中更改查询
- 直接运行查询(不使用
CREATE VIEW
... 语法)以确保它按预期运行. - 满意后,单击左侧列表中的视图以浏览其数据,然后一直滚动到底部,您将看到创建视图 链接.点击那个.
- 在OR REPLACE 字段中打勾.
- 在视图名称中输入您要更新的视图的名称.
- 在AS 字段中输入您在测试时运行的查询的内容(没有
CREATE VIEW...
语法). - 按开始
- Run the following query:
SHOW CREATE VIEW your_view_name
- Expand the options and choose Full Texts
- Press Go
- Copy entire contents of the Create View column.
- Make changes to the query in the editor of your choice
- Run the query directly (without the
CREATE VIEW
... syntax) to make sure it runs as you expect it to. - Once you're satisfied, click on your view in the list on the left to browse its data and then scroll all the way to the bottom where you'll see a CREATE VIEW link. Click that.
- Place a check in the OR REPLACE field.
- In the VIEW name put the name of the view you are going to update.
- In the AS field put the contents of the query that you ran while testing (without the
CREATE VIEW...
syntax). - Press Go
希望对大家有所帮助.特别感谢 CheesConQueso 富有洞察力的回答.
I hope that helps somebody. Special thanks to CheesConQueso for his/her insightful answer.
相关文章