I am having a temptable which stores the data temporary, in which first field is filled from query and second field is static value
temptable:
roomid.isavailable.
Now I do fill first field with following query, but how can I fill both fields at same time?
Following is the query to fill first field only
insert into temptable (RoomID)
select t1.RoomId as RoomID
from Room t1
INNER JOIN
(
select RoomID, SUM(quantity) as QTY
from Room_Item
group by RoomID
having SUM(Quantity) > 0
) t2 on t1.RoomID = t2.RoomID
order by RoomID
Just pass your static value directly to the
SELECTstatement