China Naming Network - Ziwei Dou Shu - How mysql constructs views under the condition of multi-table connection
How mysql constructs views under the condition of multi-table connection
When creating views from multiple tables, it is enough to pay attention to several aspects:
1. Specify a name for each field, which cannot be repeated.
2. You can create the field when you create it, or you can write the alias of the field in the select statement, and there can be no formula or the like.
For example:
Create? Opinion? View name?
As?
Choice? a.id,b.name? From where? A, b? Where is it? Aid or
Create? Opinion? View name? (ID card, name)?
be like
Choice? a.id,b.name? From where? A, b? Where is it? id=b.aid