check availability of a room with SQL

后端 未结 2 931
予麋鹿
予麋鹿 2021-01-25 04:55

I want to check if a certain room is available between a start and end date. I am doing this with a webservice function. This function gives back a list with all the reservation

2条回答
  •  情歌与酒
    2021-01-25 05:24

      SELECT * FROM ARTICLES_RESERVERING res
      INNER JOIN ARTICLES_ZAAL roo ON res.ZAALID = roo.ID 
      WHERE roo.ID = @ZAALID
      AND  @DATUM_EINDE between res.DATUM_BEGIN and res.DATUM_EINDE
    

    I will rather use this query as using OR is generally expensive.

提交回复
热议问题