请教大家一个SQL语句,分多

[复制链接]
查看11 | 回复1 | 2010-4-22 11:00:50 | 显示全部楼层 |阅读模式
设房型表type(typeid,typenum)线上订房表A dingA(aid,typeid,aindate,aoutdate,anum)线上订房表B dingB(bid,typeid,bindate,boutdate,bnum)房间数num,入住时间indate,离店时间outdateselect a.typeid from type a,dingA b,dingB c where (b.aindate=indate and b.aoutdate=outdate and b.anum=num and b.typeid=a.typeid) or (c.bindate=indate and c.boutdate=outdate and c.bnum=num and c.typeid=a.typeid)
回复

使用道具 举报

千问 | 2010-4-22 11:00:50 | 显示全部楼层
可以写一个语句判断房间是否为空查询房间不为空的房间号都显示出来就可以了 那样不是可以显示你所在的房间号的所有字段
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行