gpt4 book ai didi

mysql - SQL 插入或更新

转载 作者:行者123 更新时间:2023-11-29 07:12:54 25 4
gpt4 key购买 nike

从这里开始:SQL INSERT from SELECT并在此处标记了正确答案。

我还需要能够通过使用用户名来检查该行是否已经存在。那么我会删除然后插入还是有更好的方法?如果是删除,我怎么说 DELETE FROM table WHERE UserID = do the username select here谢谢

最佳答案

如果删除那么你可以使用:

DELETE a FROM Avatar a LEFT JOIN User u ON a.UserID=u.UserID WHERE u.UserName='theusername'

关于mysql - SQL 插入或更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3411538/

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