我想通过检查预订日期或即将到来的日期的时段可用性来更新我的conference_room_booking表

时间:2017-03-23 23:16:59

标签: sql lookup

我有两个table room_detail和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

用户已预订房间并想要更新conference_room_booking
通过检查那天的时间段(例如-2-4,5-7,9-10)或
的可用性来确定表格 有一天,也可以更改room_name。

条件:用户不应预订过去的日期或时间

如何在sql查询中执行此操作?在sql查询中可以完成哪些部分? 请帮忙。

1 个答案:

答案 0 :(得分:0)

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

{
    "Version": "1-1-1",
    "Id": "Policy111111111",
    "Statement": [
        {
            "Sid": "Sxxxxxxx1234",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": [
                "arn:aws:s3:::mybucket",
                "arn:aws:s3:::mybucket/*"
            ],
            "Condition": {
                "StringNotEquals": {
                    "aws:sourceVpc": "vpc-a8xxxxx"
                }
            }
        },
        {
            "Sid": "RequiredEncryptedPutObject",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:PutObject",
            "Resource": "arn:aws:s3:::mybucket/*",
            "Condition": {
                "StringNotEquals": {
                    "s3:x-amz-server-side-encryption": [
                        "AES256",
                        "aws:kms"
                    ]
                }
            }
        }
    ]
}