我有两个表:table1,table2. Table1有10列,table2有2列.
SELECT * FROM table1 AS T1 INNER JOIN table2 AS T2 ON T1.ID = T2.ID
我想从table1中选择所有列,只从table2中选择1列.是否有可能没有枚举table1中的所有列?
解决方法
是的,您可以执行以下操作:
SELECT t1.*,t2.my_col FROM table1 AS T1 INNER JOIN table2 AS T2 ON T1.ID = T2.ID