0

I have two table room_detail and conference_room_booking

room_detail       conference_room_booking
-------------     ------------------------
room_id PK        room_booking_id PK
room_name         room_id
no_of_seat        user_id
                  date
                  from_time
                  to_time
                  room_status
                  creation_time

User already booked room and wants to update conference_room_booking
table by checking availability of time slot(eg-2-4,5-7,9-10) on that day or
other day, and can change room_name also.

Condition: user should not book the past date or time

How to do that in sql query? What portion can be done in sql query? Please help.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Gopal Prasad
  • 1
  • 1
  • 2

1 Answers1

0

https://stackoverflow.com/a/2334741/1385774

UPDATE
    Table_A
SET
    Table_A.col1 = Table_B.col1,
    Table_A.col2 = Table_B.col2
FROM
    Some_Table AS Table_A
    INNER JOIN Other_Table AS Table_B
        ON Table_A.id = Table_B.id
WHERE
    Table_A.col3 = 'cool'
Community
  • 1
  • 1
RoMEoMusTDiE
  • 4,739
  • 1
  • 17
  • 26