gpt4 book ai didi

SQL : How to Delete Rows; when defending “WHERE” from another table with Multiply Returns

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

查询

    DELETE FROM TEMPSchedules 
WHERE StudentID = ( Select StudentID
From Students
Where Ref = 'H1007')

错误信息

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

问题

现在的问题是每个“Ref Group”都有超过 1 个 Student。那么我该如何处理呢。谢谢

最佳答案

  DELETE FROM TEMPSchedules 
WHERE StudentID in ( Select distinct StudentID
From Students
Where Ref = 'H1007')

关于SQL : How to Delete Rows; when defending “WHERE” from another table with Multiply Returns,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13175703/

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