Limiting Results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


Ken

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux