gpt4 book ai didi

php - SQL table1 row_id 不显示 table2 row_id

转载 作者:行者123 更新时间:2023-11-29 01:28:05 25 4
gpt4 key购买 nike

下面是我的 SQL 查询

select c.course_id,c.course_title,c.course_credits,c.course_status from       
course c,(select course_id from completed_course
where student_id='1229CSE00241') as a
where c.course_id!=a.course_id

但它也显示了 a 类(class)的所有行,但我只想要 c 的类(class)
不在类(class)中。

最佳答案

select 
c.course_id,
c.course_title,
c.course_credits,
c.course_status
from course c
where
c.course_id NOT IN (select course_id from completed_course where student_id='1229CSE00241');

关于php - SQL table1 row_id 不显示 table2 row_id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30431914/

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