5 messages in com.mysql.lists.win32Re: Limiting Results
FromSent OnAttachments
kc...@cornell.edu18 May 2005 15:40 
Randy Lovin18 May 2005 15:42 
kc...@cornell.edu18 May 2005 18:58 
Chris Robinson19 May 2005 01:49 
SGr...@unimin.com19 May 2005 05:52 
Subject:Re: Limiting Results
From:Chris Robinson (crob@manchester.actaris.com)
Date:05/19/2005 01:49:38 AM
List:com.mysql.lists.win32

I'm just guessing here, but possibly a "GROUP BY a.college" would do it?

Chris.

At 23:40 18/05/2005, kc@cornell.edu wrote:

I am trying to limit results pulled from two tables, each with all states and congressional districts, to specified congressional districts. I want each college to appear once matched to each congressional district (that is in one table and is easy to do) and also include a column from a second table with the Representative. My syntax, below, produces far too many results, matching college and district and Representative many times.

The syntax:

select a.college, a.state, a.cd, b.rep from a, b

where

a.state = "al" and a.cd = "3" or a.state = "az" and a.cd = "1" and

a.state = b.state and a.cd = b.cd

What do I do to limit to single match for each college in the specified congressional districts?