Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE: [PHP-DB] Limiting Results
I believe you need a main table where youn list all the colleges with
columns for STATE, CONGRESSIONAL DISTRICT and REPRESENTATIVE.

And those three columns would be pulled from three table catalogs: STATES,
CONGRESSIONAL DISTRICTS and REPRESENTATIVES.

Maybe there is a better approach, but I don't know the way your states or
country is organized.
Miguel

-----Original Message-----
From: kc68@cornell.edu [mailto:kc68@cornell.edu]
Sent: Jueves, 19 de Mayo de 2005 07:13 a.m.
To: php-db@lists.php.net
Subject: [PHP-DB] Limiting Results


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

Report this thread to moderator Post Follow-up to this message
Old Post
Miguel Guirao
05-19-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:09 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.