That's what I have right now, but that won't return the other grades. It
will show the people that have A's, but it won't return their B's C's and
D's. I think it's an outer join of some sort, but I haven't been able to get
it to work with my conditions.

Adam.


> -----Original Message-----
> From: LANCASTER, STEVEN M. (JSC-OL) (BAR)
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 10:44 AM
> To: CF-Talk
> Subject: RE: Hypothetical SQL question
> 
> 
> Hope this helps :)
> 
> <cfset goodgrade = "A">
> 
> <CFQUERY name="getgradeA" datasource="datasource">
> Select Distinct   people.people,
>               grades.grades
> FROM          grades,
>               people
> Where         people.people_id = grades.people_id
> AND           grades.grades = '#goodgrade#'
> </CFQUERY>
> 
> 
> Steven Lancaster
> Barrios Technology
> NASA/JSC
> 281-244-2444 (voice)
> [EMAIL PROTECTED] 
> 
> 
> 
> -----Original Message-----
> From: Cantrell, Adam [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 10:32 AM
> To: CF-Talk
> Subject: Hypothetical SQL question
> 
> 
> Hypothetical SQL question:
> 
> I have a table called PEOPLE and a table called GRADES. I'd 
> like to return a
> list of people and all of their grades and then output the 
> results in a
> cfoutput, grouping by peopleID. Ok, that's easy enough, but 
> what if I only
> want to return people that have an A as one of their grades? 
> What type of
> condition do I use to achieve this? Currently I'm able to 
> pull the people
> that have an A, but it won't return the other grades, so it 
> ends up with a
> bunch of people with just one or more A's - it won't show 
> their B's, C's,
> and D's.
> 
> This seems way to easy, but I'm struggling with it this 
> morning for some
> reason, maybe someone can give me a little push.
> 
> Adam.
> 
> 
> 
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to