MySQL(NOT IN)...帮助 [英] MySQL ( NOT IN )... HELP

查看:57
本文介绍了MySQL(NOT IN)...帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们有一个带有学生的表格,另一个带有课程的表格
例如
课程(数学,生物学,技术)


现在,如何选择所有非生物学专业的学生...

任何答案吗?

解决方案

从学生,drejtimi d中选择emri,mbiemri,emri_d,而不是s.did = d.did(emri_d =''Teknologji Informacioni dhe Telekomonikim'');

解决方法:)


我尝试了这个,但是没有用!任何想法

从studenti s,drejtimi d中选择emri,mbiemri,emri_d,其中s.did = d.did且emri_d不在("Teknologji notifyacioni dhe telekomunikimi"); "SQL"> 选择(您的学生姓名表格例如:学生.*) INNER 打开(您的外国 钥匙 例如:Students.FK_Courses)= Courses.ID 位置 (您的课程名称,例如:Courses.Name)= ' 生物学'



注意:使用时将()删除,并尝试下次比仅询问


If we have a Table with Students and another table with Courses
ex.
Courses ( Math , Biology , Technology )


Now, HOW to select All students that are NOT in Biology...

Any answer ?

解决方案

select emri,mbiemri,emri_d from studenti s, drejtimi d where s.did=d.did and not (emri_d=''Teknologji Informacioni dhe Telekomonikim'');

The solution :)


I try this one, but it does not work ! Any idea

select emri,mbiemri,emri_d from studenti s , drejtimi d where s.did = d.did and emri_d not in (''Teknologji informacioni dhe telekomunikimi'');


SELECT (Your students name table ex: Students.*) FROM Students INNER JOIN Courses ON (your foreign key column ex: Students.FK_Courses)= Courses.ID WHERE NOT (your course name column ex: Courses.Name)= 'Biology'



Note: remove () when using it and try to google next time better than just asking


这篇关于MySQL(NOT IN)...帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆