locked
doubts in create VIEW in MYSQL RRS feed

  • Question

  • User944339287 posted

    Dear all, based on my understanding.

    1) The purpose of create VIEW is to expetide query result right? (speed of result returned) what else?

    2) How can i handle duplicate column name 'customer_id'

    CREATE VIEW view_customer AS SELECT * FROM customer_master cm INNER JOIN customer_personal_profile cpp ON cm.customer_id = cpp.customer_id


     

    Thursday, January 3, 2013 11:10 PM

Answers

  • User672540984 posted

    if duplicate the column name, you might manually to rename it.

    for example:

    select a.aaa as NameA, b.aaa as NameB from a inner join b on a.id=b.id 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 3, 2013 11:18 PM