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本回答被提问者和网友采纳