表1包含列:entry_id user_id …表2包含列:entry_id user_id …
user_id条目并不总是相同的,因此我想将它们都提取出来,以便以后可以在脚本中对它们进行比较
SELECT * FROM table1 as t1 INNER JOIN table2 as t2 on t1.entry_id=t2.entry_id WHERE t1.user_id='%s'
我想提取t1.user_id和t2.user_id …问题是结果数组只有user_id
谢谢你
使用AS关键字:
AS
SELECT t1.user_id as t1_user_id ,t2.user_id as t2_user_id FROM table1 as t1 INNER JOIN table2 as t2 ON t1.entry_id=t2.entry_id WHERE t1.user_id='%s'