我有一个简单的问题
我有一张带有openid和另外两张桌子的桌子 连接它们的是userid
但我必须开始在de openid表中查找userid 这可以在一个选择语句中完成,还是需要两个
我试过这个,但显然不起作用
选择操作*
,g *
,gp *
FROM openid
AS op
INNERJOIN users
AS g ON(g。userid
= op。userid
)
INNERJOIN profiles
AS gp ON(gp。userid
= op。userid
)
op。openid
= 2
答案 0 :(得分:2)
试
SELECT op.*, g.*, gp.*
FROM openid AS op
INNER JOIN users AS g ON g.userid = op.userid
INNER JOIN profiles AS gp ON gp.userid = op.userid
WHERE op.openid = 2