Hello ,
I have a table Room_info
which has following fields and the table fields cannot be changed at any cost :
---------------------------------------------------------------------------------
Room_number| Check_In Date| Check_Out Date| Confirmation_Id | Room_type
The characters are as follows :
Room_number
Char(3)
Not Null
Check_In Date
Date
Not Null
Check_Out Date
Date
Not Null
Confirmation_Id
Char(16)
Foreign Key to Customer Info table
Room_type
Numeric(3)
Not Null
I have to fetch the available room numbers when inputted with Check in date and check out date. and I have to pick more than 2 rooms for booking.
I had written the query for fetching the room numbers
Code:
SELECT distinct ROOM_NUMBER FROM IDCL58.ROOM_INFO
where room_number != (select distinct room_muber from IDCL58.ROOM_INFO
where type=1
and Check_in_date >= 2009-08-06
and Check_out_date <= 2009-10-06)
but the sub query is fetching multiple rooms,And I want to fetch the room numbers one after the another.
How do I go about it.
_________________
Syed Sameer Ahmed
Code: Select all