[thelist] complicated sql

Ken Moore psm2713 at hotmail.com
Mon Dec 8 05:07:11 CST 2003


Hi all,

Comitque wrote:

>Hey everyone, I have a complicated SQL query but I can't produce the 
>results
>that I want...

So, what so you want?

Ken


>I have three tables.  it looks something like this:
>(the site is for a venue/club)
>
>BANDS
>band_id | band_name
>
>SHOW INFO
>show_id | show_date | band_id (same id as the bands.band_id)
>
>PHOTOS
>photo_id | photo_name | photo_bandid (same id as the bands.band_id)
>
>How do I write a query to retrieve BANDS.band_name, SHOWINFO.show_date, and
>PHOTOS.photo_name?  I had this:
>
>SQLQuery = "select * from showinfo, bands, photos where (bands.band_id =
>photos.photo_bandid and showinfo.band_id = bands.band_id) order by
>showinfo.show_date"
>
>But that didn't quite work...
>
>Any ideas what I'm doing wrong?  I'd really appreciate the help.
>
>Thanks!

_________________________________________________________________
Get holiday tips for festive fun. 
http://special.msn.com/network/happyholidays.armx



More information about the thelist mailing list