$result = mssql_query(" select Name_Sc,Name_Tc,Requirement.ID_Sc,Requirement.ID_Tc
from School,Teacher,Requirement
where School.ID_Sc = Requirement.ID_Sc and Teacher.ID_Tc = Requirement.ID_Tc and Requirement.Re_Status = 'connect'
EXCEPT
(select Name_Sc,Name_Tc,Requirement.ID_Sc,Requirement.ID_Tc
from School,Teacher,Requirement,Promise
where School.ID_Sc = Requirement.ID_Sc and Teacher.ID_Tc = Requirement.ID_Tc and Requirement.Re_Status = 'connect' and Requirement.ID_Sc = Promise.ID_Sc and Requirement.ID_Tc = Promise.ID_Tc)");
คราวนี้มาทำเปงmysqlใช้ตัวไหนค่ะแบบไม่เท่ากับอ่าค่ะลองเปลี่ยนเป็น not in หรือ
!= แล้วแต่ก้อยังไม่ได้
mysql แบบนี้
Code (PHP)
$result = mysql_query(" select Name_Sc,Name_Tc,Requirement.ID_Sc,Requirement.ID_Tc
from School,Teacher,Requirement
where School.ID_Sc = Requirement.ID_Sc and Teacher.ID_Tc = Requirement.ID_Tc and Requirement.Re_Status = 'connect' not in
(select Name_Sc,Name_Tc,Requirement.ID_Sc,Requirement.ID_Tc
from School,Teacher,Requirement,Promise
where School.ID_Sc = Requirement.ID_Sc and Teacher.ID_Tc = Requirement.ID_Tc and Requirement.Re_Status = 'connect' and Requirement.ID_Sc = Promise.ID_Sc and Requirement.ID_Tc = Promise.ID_Tc)");
และแบบนี้
Code (PHP)
$result = mysql_query(" select Name_Sc,Name_Tc,Requirement.ID_Sc,Requirement.ID_Tc
from School,Teacher,Requirement
where School.ID_Sc = Requirement.ID_Sc and Teacher.ID_Tc = Requirement.ID_Tc and Requirement.Re_Status = 'connect' and
Requirement.ID_Sc != Promise.ID_Sc and Requirement.ID_Tc != Promise.ID_Tc");