sql怎么样合并两个查询结果 横向显示出来?
select*from(selectd_roomid,d_typefromROOMPRICE)asa,(selectd_roomid,d_personnamefromRE...
select * from (select d_roomid,d_type from ROOMPRICE) as a, (select d_roomid,d_personname from REGISTER where REGISTER.D_EXCHANGE='否' and REGISTER.D_STATE='未结帐' ) as b where a.D_ROOMID=b.D_ROOMID这样会让register.d_roomid 显示一样的房间和名字 其实只有8207有其他房间是没信息的
展开
展开全部
select a.d_roomid,a.d_type,b.d_roomid,b.d_personname from
ROOMPRICE a
left join REGISTER b on b.D_EXCHANGE='否' and b.D_STATE='未结帐'
and a.D_ROOMID=b.D_ROOMID
ROOMPRICE a
left join REGISTER b on b.D_EXCHANGE='否' and b.D_STATE='未结帐'
and a.D_ROOMID=b.D_ROOMID
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询