Re: LEFT JOIN help (or "come and slap the newbie")

2003-12-29 Thread Hans van Harten
Dan Hansen wrote: > is essentially giving me what I need: > > CREATE TEMPORARY TABLE temptable > SELECT state.name AS state , group.name AS group, > group.zip AS zip, city.name AS city > FROM city, group, zip > LEFT JOIN state ON city.state_id = state.id > WHERE group.zip = zip.zip > AND zip.city_

Re: LEFT JOIN help (or "come and slap the newbie")

2003-10-15 Thread Dan Hansen
For everyone who helped, THANK YOU!! For anyone who might be interested, here's what finally did the trick and is essentially giving me what I need: CREATE TEMPORARY TABLE temptable SELECT state.name AS state , group.name AS group, group.zip AS zip, city.name AS city FROM city, group, zip LEFT J

Re: LEFT JOIN help (or "come and slap the newbie")

2003-10-15 Thread Roger Baklund
* D. R. Hansen > At 03:51 AM 10/15/03, Diana Soares wrote: > >You're confusing the left/right "sides" of LEFT JOIN... > >Using LEFT JOIN, it is the right table that is dependent on the left > >table. All results from left table are selected. > >So you may try: [...] > I believe I tried that -- but

Re: LEFT JOIN help (or "come and slap the newbie")

2003-10-15 Thread D. R. Hansen
I believe I tried that -- but when I did (and I just repeated it with the same result) mysql effectively hangs (i.e. the query takes interminably long -- I let it run for 20 minutes before killing it). So should I be looking at an indexing issue? Right now the only things indexed in the tables

Re: LEFT JOIN help (or "come and slap the newbie")

2003-10-15 Thread Diana Soares
You're confusing the left/right "sides" of LEFT JOIN... Using LEFT JOIN, it is the right table that is dependent on the left table. All results from left table are selected. So you may try: SELECT state.name AS state , group.name AS group, group.zip AS zip, city.name as city FROM state LEF

LEFT JOIN help (or "come and slap the newbie")

2003-10-14 Thread D. R. Hansen
Uberdumb question - but I'm still enough of a newbie that this is giving me fits... I have four tables, with relevant columns as follows: ++ ++ group zip -- -- name varchar city_id int zip mediumint zip mediumint