At 09:02 16.07.01 -0700, John Hawkins wrote:
>I'm having a bit of trouble doing a LEFT JOIN. Any input would be greatly 
>appreciated.
>
>table 1 (sites, has approx 30 records) has a list of sites with the 
>following fields:
>ID, sitename, url
>
>table 2 has (ratings, has approx 2020 records) has a list of member 
>ratings for the different sites with the following fields:
>ID, siteID, memID, rating
>
>- sites.ID matches up with ratings.memID
>- memID is the ID of the member who performed this rating

Is this really so??
it should be sites.ID matches ratings.siteID?

>I want to show the member who is logged in a list of all the sites that he 
>has not yet rated.
>
>here is the select statement I have created, but isn't quite working:
>
>SELECT sites.* FROM sites LEFT JOIN ratings ON sites.ID = ratings.siteID 
>WHERE ratings.memID != '1'

then the select looks like that:
SELECT sites.* FROM sites LEFT JOIN ratings ON sites.ID = ratings.siteID 
WHERE sites.ID = ratings.siteID and ratings.memID!=1
Or have I understand something wrong??

Regards Gerlinde


>I am getting approx 2020 results (which, oddly enough, matches the amount 
>of records I have in the "ratings" table).
>
>Like I said, any help would be greatly appreciated.
>
>Best,
>
>John
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail 
><[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

               BLITZ Internet Service GmbH
                       Kronacher Strasse 41
                     D-96052 Bamberg, Germany
            Tel. +49/951/9685160, Fax +49/951/9685164
                       http://www.blitz.net 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to