mysql写一句sql语句,有pg_Inquiry(id )和pg_InquiryDetail(id, inquiry_id,full_estate_name)表,pg_InquiryDetail.inquiry_id跟,pg_Inquiry.id关联。现传入inquiry_id 和 full_estate_name,更新pg_InquiryDetail指定inquiry_id和full_estate_name都完全一致的pg_InquiryDetail数据
时间: 2023-07-05 14:27:44 浏览: 169
使用MySQL的LAST_INSERT_ID来确定各分表的唯一ID值
可以使用以下SQL语句来更新pg_InquiryDetail表中指定inquiry_id和full_estate_name都完全一致的数据:
```
UPDATE pg_InquiryDetail
SET full_estate_name = 'new_full_estate_name'
WHERE inquiry_id = 'inquiry_id'
AND full_estate_name = 'old_full_estate_name';
```
其中,将`new_full_estate_name`替换为要更新的新full_estate_name,将`inquiry_id`替换为要更新的inquiry_id,将`old_full_estate_name`替换为要更新的旧full_estate_name。
阅读全文