Jump to content


Photo

Help me query please


  • Please log in to reply
1 reply to this topic

#1 jantichap

jantichap
  • New Members
  • Pip
  • Newbie
  • 1 posts
  • LocationThailand

Posted 08 January 2003 - 07:03 AM

select luser.userid,luser.firstname,luser.lastname from luser
where luser.Pos = \'Teacher\'and luser.userid not in
(select sectionuser.userid from sectionuser
where sectionuser.courseid = \'204105\'and sectionuser.SectionID = \'1\' and sectionuser.Semester = \'2\')
ORDER BY luser.UserID

this query i can use in other database server but i can\'t use in MySQL version 4.0.2-alpha-nt

please!!! help me to convert my query can use in MySQL ....thank

#2 pallevillesen

pallevillesen
  • Members
  • PipPipPip
  • Advanced Member
  • 135 posts
  • LocationDenmark

Posted 08 January 2003 - 10:20 AM

A few typos, try:


SELECT luser.userid,luser.firstname,luser.lastname 

 FROM luser

 WHERE (luser.Pos = \'Teacher\') 

 AND 

 (

   luser.userid NOT IN

    (

    SELECT sectionuser.userid 

    FROM sectionuser 

    WHERE 

    (sectionuser.courseid = \'204105\') 

    AND

    (sectionuser.SectionID = \'1\') 

    AND 

    (sectionuser.Semester = \'2\') 

    )

 )

 ORDER BY luser.UserID 


Try it,
P., denmark

select luser.userid,luser.firstname,luser.lastname from luser  
where luser.Pos = \'Teacher\'and luser.userid not in  
(select sectionuser.userid from sectionuser  
where sectionuser.courseid = \'204105\'and sectionuser.SectionID = \'1\' and sectionuser.Semester = \'2\')  
ORDER BY luser.UserID  

this query i can use in other database server but i can\'t use in MySQL version 4.0.2-alpha-nt  

please!!! help me to convert my query can use in MySQL ....thank


Palle Villesen, www.birc.dk [br]Bioinformatics Research Center




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users