gpt4 book ai didi

删除的sql查询

转载 作者:行者123 更新时间:2023-12-02 05:20:26 26 4
gpt4 key购买 nike

delete  a.Employee_LastName, a.Employee_Firstname 
FROM EMPLOYEE a JOIN DEPARTMENT b on a.Department_ID = b.Department_ID
where b.Department_Name='Sales'
Group by a.Employee_LastName, a.Employee_Firstname, b.Department_Name

你能解释一下我做错了什么吗?错误(在 sql server 2008 中):消息 102,级别 15,状态 1,第 1 行“,”附近的语法不正确。

最佳答案

Delete 用于删除整行..而不是清空字段(因此不支持列名,也没有分组)

所以

DELETE EMPLOYEE
FROM EMPLOYEE a JOIN DEPARTMENT b ON a.Department_ID = b.Department_ID
WHERE b.Department_Name = 'Sales'

如果你想编辑记录然后我们 UPDATE

关于删除的sql查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13944440/

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