Shouldn't those be single quotes around the course name?
> -----Original Message-----
> From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 24, 2003 3:02 PM
> To: CF-Talk
> Subject: Re: SQL: How do I a get list of everybody that doesn't meet a
> certain criteria
>
>
> Kronenberger, Douglas wrote:
> >
> > I have a table that has multiple courses taken (CourseName)
> entries for
> > each employee (EmpID)
> >
> > This gets me everybody that took the coures.
> > SELECT EmpID, CourseName
> > FROM Course
> > WHERE CourseName = "Preventing Sexual Harassment"
> >
> > But how do I get everybody that didn't?
>
> I presume you have a table "employees" that has EmpID as the primary
> key. In that case:
>
> SELECT
> EmpID
> FROM
> Employees
> WHERE NOT EXISTS (
> SELECT
> 1
> FROM
> Course
> WHERE
> CourseName = "Preventing Sexual Harassment"
> AND
> Course.EmpID = Employees.EmpID
> )
>
> Jochem
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4