设房型表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)
|