How do I get a result across 2 tables

后端 未结 2 1711
自闭症患者
自闭症患者 2021-01-29 16:31

I have 2 tables. One is called booking and another one is called room. The columns in booking are: RoomID, startdate, enddate, customerId. The columns in room is: RoomID, size.<

2条回答
  •  [愿得一人]
    2021-01-29 17:19

    Try this code

    SELECT booking.*
    FROM booking   JOIN room  USING(RoomID)
    WHERE column_name BETWEEN startdate AND enddate AND size = @size_input;
    

提交回复
热议问题