SELECT orders.user_id as orderuserid , *
FROM submissions
INNER JOIN orders
ON orders.listing_id=submissions.listing_id where orders.user_id=
答案 0 :(得分:0)
您的查询接近正确,但通配符必须位于任何其他字段之前。正确的查询是:
SELECT *, orders.user_id as orderuserid
FROM submissions
INNER JOIN orders
ON orders.listing_id=submissions.listing_id where orders.user_id=
答案 1 :(得分:0)
为什么要两次返回相同的列?
别名星号也有效:
SELECT orders.user_id as orderuserid , submissions.*, orders.*
FROM submissions
INNER JOIN orders
当然,你根本不应该使用*
。