37

How do I create a view in MySQL?

6
  • 11
    Do you have any problem with the manual? dev.mysql.com/doc/refman/5.0/en/create-view.html Mar 3, 2011 at 20:08
  • 2
    @@nick rulez: I always trust stackoverflow for different types of suggestions and answers. that's y i posted here.
    – Fero
    Mar 5, 2011 at 6:48
  • 2
    Thanks for the compliment. However, we'd rather you try to figure it out first.
    – mellamokb
    Mar 5, 2011 at 13:01
  • @@mella: Thanks for your advice mella. Hereafter i will do the same and if i didn't get my exact answer i will come here... :-)
    – Fero
    Mar 7, 2011 at 4:40
  • bindasmonkeys.com/views-mysql-create
    – user4861457
    Mar 18, 2016 at 7:15

2 Answers 2

56

http://dev.mysql.com/doc/refman/5.5/en/create-view.html

Example:

Create View `MyViewName` as 
    Select
        col1, col2, col3
    From
        myTable T
8
CREATE VIEW v AS SELECT * FROM t;

Not the answer you're looking for? Browse other questions tagged or ask your own question.