SELECT *,
(SELECT *
FROM regions WHERE regions.RID=registration.REGION) as region_out
FROm registration
1241 - 操作数应包含1列
答案 0 :(得分:2)
SELECT r1.*, r2.*
FROM registration r1,
INNER JOIN regions r2 ON ( r2.RID=r1.REGION )
答案 1 :(得分:1)
子查询只能返回一个值,因此您无法SELECT *
。这是错误消息告诉你的内容。您只能选择一个列或值。
答案 2 :(得分:0)
你写得更好:
SELECT registration.*, regions.*
FROM regions
join registration on regions.RID=registration.REGION;
答案 3 :(得分:0)
试试这个:
SELECT * FROM registration
LEFT JOIN regions ON (regions.RID=registration.REGION);