mysql 查询语句求助
selectou.spreadspread,p.userNameuserName,p.namechrName,p.logoutTimetime,p.playerIdpla...
select ou.spread spread,p.userName userName,p.name chrName,p.logoutTime time,p.playerId playerId from player p LEFT JOIN oluc_user ou on p.userName=ou.UserName where ou.Id=5;这段查询出来的数据为
目前还想从playerbattle表里面查询字段:level 并显示player和playerbattle表里面有相同字段playerId请问大神们,如何修改语句谢谢!!! 展开
目前还想从playerbattle表里面查询字段:level 并显示player和playerbattle表里面有相同字段playerId请问大神们,如何修改语句谢谢!!! 展开
3个回答
展开全部
直接用多表查询,把多个表用逗号隔开,加上条件即可
select ou.spread spread,p.userName userName,p.name chrName,p.logoutTime time,p.playerId playerId,b.level from player p, oluc_user ou, playerbattle b where p.userName=ou.UserName and ou.Id=5 and p.playerId=b.playerId;
select ou.spread spread,p.userName userName,p.name chrName,p.logoutTime time,p.playerId playerId,b.level from player p, oluc_user ou, playerbattle b where p.userName=ou.UserName and ou.Id=5 and p.playerId=b.playerId;
追问
谢谢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
选择ou.spread蔓延,p.userName用户名,p.na我chrName,p.logoutTime时间,p.playerId玩家ID来回米运动员P LEFT JOIN上p.userName oluc_user OU = O u.UserName其中ou.Id = 5;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select
ou.spread spread,
p.userName userName,
p.name chrName,
p.logoutTime time,
p.playerId playerId,
pb.level
from
player p
LEFT JOIN oluc_user ou on p.userName=ou.UserName
LEFT JOIN playerbattle pb on p.playerId = pb.playerId
where ou.Id=5;
有问题,请追问。
ou.spread spread,
p.userName userName,
p.name chrName,
p.logoutTime time,
p.playerId playerId,
pb.level
from
player p
LEFT JOIN oluc_user ou on p.userName=ou.UserName
LEFT JOIN playerbattle pb on p.playerId = pb.playerId
where ou.Id=5;
有问题,请追问。
追问
谢谢搞定!!!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询