I have two tables - room and roomBooking which include;
room
rCode | rName | building | capacity | disabledAccess
Text | Text | Text | Number | Yes/No
roomBooking
bookingID | roomCode | moduleCode | dayReq | timeReq | semester | classSize
Number | Text | Text | Text | Day/Time| Number | Number
I want to write an UPDATE statement to update the rooms that are not booked at any time - the results are shown in the SELECT query below
SELECT rCode, disabledAccess
FROM room
LEFT JOIN roomBooking
ON room.rCode = roomBooking.roomCode
WHERE roombooking.roomCode IS NULL;
How do I change this into an UPDATE statement?
You can go down this path, but you need a
left join
and then a comparison for determining which rows don't match. You don't need anexists
clause in this case:EDIT:
MS Access accepts
join
syntax forupdate
:Is it not clear what columns you want to update.