我有两张表格,各栏数各不相同。 (我不知道有多少栏目或名称是什么)例如表A和表B。
表A:
ID | B_ID | {variable}
表B
ID | {variable}
学历:
SELECT TableA.*, 表B.* FROM TableA INNER JOIN 表B ON TableA.B_ID= 表B.id;
When TableA and 表B both have a column with a same name I can t distinguish between the two different columns. For example of both tables has the column "Name" this query would result in :
ID | ID | B_ID | NAME | NAME |
1 | 35 | 35 | bob | jim |
我所期待的是区分两个表格的方法。 最好有一栏名的前奏。
TableA_ID | 表B_ID | TableA_B_ID | TableA_NAME | 表B_NAME |
1 | 35 | 35 | bob | jim |
I know of the "AS" keyword but the problem is that I don t know what the column names are going to be before hand. (I don t know if TableA or 表B are going to have the column Name)
因此,我的问题是:
当两个表的栏目可能有相同的栏目时,你如何区分两个表的栏目?
我正在使用Kallite3。