You are here: Re: help with multiple table join « MySQL Databases « IT news, forums, messages
Re: help with multiple table join

Posted by Mike Easter on 10/21/05 06:40

For some reason, in the third table I named the field bids_ID (instead of
list_ID). That was the cause of my troubles; the query structure was fine
other than the phantom field. I guess MySQL is incapable of protecting me
from myself.

Mike Easter <username@domain.com> wrote in
news:Xns96F4C148F65D8usernamedomaincom@216.196.97.136:

> I can't seem to get this to work!
>
> I have three tables: tbl_watch, tbl_items, tbl_highbids. To simplify,
> let's say they have the following fields:
>
> tbl_watch: client_ID, list_ID
> tbl_items: list_ID, list_Desc
> tbl_highbids: list_ID, list_Bid
>
> I want to do a straight join on tbl_watch and tbl_items on list_ID.
> I want to do a LEFT join on the resulting dataset to tbl_highbids (in
> other words, I want my final result set to include all records in my
> tbl_watch-to-tbl_items join, even if the list_ID doesn't exist in
> tbl_highbids).
> Further, I'd like to limit the dataset by tbl_watch.client_ID.
>
> I've looked at the mySQL online help, but none of the permutations I've
> tried give me anything in my result set when I try to add the LEFT join
> to the third table.
>
> Here's how I interpreted mySQL's example for my purposes:
>
> SELECT tbl_watch.list_ID, tbl_items.list_Desc, tbl_highbids.list_Bid
> FROM (tbl_watch, tbl_items)
> LEFT JOIN tbl_highbids ON (tbl_highbids.list_ID = tbl_watch.list_ID)
> WHERE tbl_watch.list_ID = tbl_items;
>
> (Even though this doesn't limit on client_ID, it still returns no
> records!).
>
> Any help would be REALLY, REALLY appreciated!
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация