Jay wrote:[color=blue]
> Hi everyone !
>
> I hope someone will be able to help me with this problem.
> I currently have several tables in MySQL database. Below is my table
> structures.
>
> (Data type for each fields are ignored)
>
> user
> {
> uid,
> firstname,
> lastname,
> date_added,
> }
>
>
>
> contact
> {
> uid, //same as "uid" in "user" table.
> e-mail,
> homephone,
> workphone,
> cellphone,
> address,
> city,
> state,
> zipcode
> }
>
>
> //each field in the classes table contains a grade that the user
> (student) got form
> //taking that class.
> classes
> {
> uid //same id as "uid" in the "user" table.
> political100,
> history101,
> bio109,
> .....
> ....etc...
>
> }
>
> My goals include the following things:
>
> 1. Search for users(students) in a particular city/state/zipcode that
> completed a certain
> classes (let's say bio109 with an "A" OR history 101 with a "B" or a
> combination of all classes with
> different combination of "grades". How would I write a "SELECT"
> statement that would accomplish this task ?
>
> 2. Please note that table contact and classes have a Primary keys that
> are not "auto-increment"
> The primary keys are from table "user".
>
>
> I am sorry for such a lengthy message.
>
> Any help would be appreciated ! Thank you in advance,
>
> Jay Hana
>[/color]
Jay,
I agree with Micha. You should look into normalizing your database.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================