1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

count how many nights each room of an hotel had been rent for a complete year?

Discussion in 'SQL - Questions and Answers' started by alexfr, May 24, 2006.

  1. alexfr New Member

    Dialect: MySQL
    count how many nights each room of an hotel had been rent for a complete year
  2. alexfr New Member

    Dialect: MySQL
    SQL:

    SELECT SUM(ROOM_FULL_NB_CUST), R.ROOM_ID
    FROM T_ROOM R
    JOIN TJ_ROM_FULL_CUST P
    ON R.ROOM_ID = P.ROOM_ID
    WHERE PLN_JOUR BETWEEN '2002-01-01' AND '2002-12-31'
    GROUP BY R.ROOM_ID

Share This Page