日期:2014-05-16  浏览次数:20665 次

急求!如何创建mysql的视图并输出到浏览器显示?能否实现?
如题,希望大神给出示例!

------解决方案--------------------
create view as select * from table1 where id<10
------解决方案--------------------
引用12.1.16. CREATE VIEW Syntax
CREATE
[OR REPLACE]
[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]


------解决方案--------------------
引用我想把视图的结果输出到浏览器啊,不知道如何实现

------解决方案--------------------
创建视图:CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;
访问视图:SELECT * FROM v;