是否有可能在MySQL中创建动态使用其他表中的其他列的表(与在PHP中扩展类的想法相同).例:
table1
table1_id
column1
column2
column3
table2
table2_id
column4
column5
Run Code Online (Sandbox Code Playgroud)
因此,当我查询table2时,我得到table1中的所有列,如:
SELECT table1_id,column1,column2,column3,table2_id,column4,column5 FROM table2;
Run Code Online (Sandbox Code Playgroud)
小智 8
CREATE VIEW t2_view AS <SELECT stuff FROM t1,t2> (not sure exactly how you want to join t1 and t2)
SELECT * FROM t2_view;
Run Code Online (Sandbox Code Playgroud)
我认为这样的东西就是你要找的东西.
| 归档时间: |
|
| 查看次数: |
221 次 |
| 最近记录: |