gpt4 book ai didi

mysql - 加速/制作更高效的 SQL

转载 作者:行者123 更新时间:2023-11-29 04:10:55 25 4
gpt4 key购买 nike

这是我的确切 SQL 代码,但它非常慢而且我知道这很糟糕......

有没有另一种方法可以做到这一点,但速度更快?

UPDATE Customer SET Title = "MR", SurName = "Test", FirstName ="Bob", HomePostCode ="SW18" WHERE CustomerID IN (SELECT CxID FROM Production WHERE policy_number = "001C5T" AND member_number = "100" AND family_group = "000001" AND CxID > 0)

谢谢

最佳答案

试试这个(未经测试)

UPDATE Customer c
JOIN Production p ON p.CxID = c.CustomerID
SET c.Title = "MR",
c.SurName = "Test",
c.FirstName ="Bob",
c.HomePostCode ="SW18"
WHERE p.policy_number = "001C5T"
AND p.member_number = "100"
AND p.family_group = "000001"
AND p.CxID > 0

关于mysql - 加速/制作更高效的 SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11312361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com