Mysql Views

Hi,

Following syntax is to create view in mysql.

One table user : id,fname,mname,lname,created_at
then create a table in the mysql
After that create a view.

Create or replace view user_view as select id, concat(fname,’ ‘,mname,’ ‘,lname),created_at from user;

Then it created a View.

Anil Kumar Panigrahi

With more than 10 years experience in PHP and Founder of Anil Labs, a blog for PHP and related posts. contributed posts regarding CodeIgniter, CakePHP and Learn PHP online ... Contact : [email protected]

You may also like...

2 Responses

  1. Reji says:

    but use “replace” with caution,

    its like this,
    CREATE or REPLACE view as

  2. Reji says:

    create or replace view view_name as your_select_statement.

Leave a Reply

Your email address will not be published. Required fields are marked *