views:

98

answers:

5

Are there any limitations in the functionality of SQL Views for MySQL?

ex: Can you create a table view using 'JOIN' commands?

A: 

MySQL allows JOIN commands

MySQL Create View syntax

Trevor
A: 

Regarding JOIN, yes:

mysql> create table foo (i int);
Query OK, 0 rows affected (0.03 sec)

mysql> create table bar (i int);
Query OK, 0 rows affected (0.03 sec)

mysql> create view foobar as select foo.i as foo_i, bar.i as bar_i from foo join bar on (foo.i=bar.i);
Query OK, 0 rows affected (0.02 sec)

But as others answers pointed, the manual is a great resource.

ggiroux
+4  A: 

You should read Restrictions on Views for details on view limitations.

Bill Karwin
A: 

Short answer - yes. In two words view just named select (without order by of course).

Alexey Sviridov
A: 

As everything else in SQL, the syntax, features and possibilities depend on the database management system you are working with. But joining tables is pretty basic stuff. Views would not be of much use without it.

Álvaro G. Vicario