Bug #10430 create view
Submitted: 7 May 2005 9:21 Modified: 7 May 2005 9:25
Reporter: foro linux Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.7-standard for pc-linux on i686 (Off OS:Linux (Fedora Core 2)
Assigned to: CPU Architecture:Any

[7 May 2005 9:21] foro linux
Description:
On a fresh installation, I try to reproduce the create view Reference Manual's sample

mysql> CREATE TABLE t (qty INT, price INT);
mysql> INSERT INTO t VALUES(3, 50);
mysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;
mysql> SELECT * FROM v;
+------+-------+-------+
| qty  | price | value |
+------+-------+-------+
|    3 |    50 |   150 |
+------+-------+-------+

And I've got the following error after the create view line:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VIEW v AS SELECT qty, price, qty*price AS value FROM t' at line 1

How to repeat:
CREATE TABLE t (qty INT, price INT);
INSERT INTO t VALUES(3, 50);
CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;
SELECT * FROM v;
[7 May 2005 9:25] Hartmut Holzgraefe
Views are only supported as of MySQL 5.0, they are not included in 4.1