Re: Left Join Help

2006-06-24 Thread Daniel McQuay
the thing with JOINs are you gotta JOIN a table ON another table where something matches something else (in most cases). I tried to clean this up a bit but im rather new to mysql. SELECT DISTINCT (td.td_id), td.venue_id as ven_id, td.td_date as td_date, art.NAME as art_name, art.WEB as art_url,

Left Join Help

2006-06-23 Thread Paul Nowosielski
Dear All, I've been hashing out this query for awhile with no luck as of yet. Basically the query works if I put a limit of 500 or so but when I do the full query it takes up so many resource that the database engine is useless. Here is the query: SELECT DISTINCT (td.td_id) ,td.venue_id as

Re: Left Join Help

2006-06-23 Thread Gerald L. Clark
Paul Nowosielski wrote: Dear All, I've been hashing out this query for awhile with no luck as of yet. Basically the query works if I put a limit of 500 or so but when I do the full query it takes up so many resource that the database engine is useless. Here is the query: SELECT DISTINCT

Re: Left Join Help

2006-06-23 Thread Brent Baisley
= art.PKEY AND td.venue_id=tv.ID) LIMIT 500 - Original Message - From: Paul Nowosielski [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Friday, June 23, 2006 3:27 PM Subject: Left Join Help Dear All, I've been hashing out this query for awhile with no luck as of yet. Basically the query

Re: Left Join Help

2006-06-23 Thread Gerald L. Clark
I ammend my previous post. Paul Nowosielski wrote: Dear All, I've been hashing out this query for awhile with no luck as of yet. Basically the query works if I put a limit of 500 or so but when I do the full query it takes up so many resource that the database engine is useless. Here is the

Re: Left Join Help

2006-06-23 Thread Peter Brawley
Paul, SELECT ... FROM tourdates td, tbl_ARTST as art, artist_tourdate artd , tbl_VENUES tv, tbl_VENUE_CAPACITY tvc , tbl_VENUE_AGE_XREF tvax, tbl_VENUE_AGES tvage LEFT JOIN tbl_VENUE_CAPACITY ON (tv.ID=tvc.VENUE_ID) LEFT JOIN tbl_VENUE_AGE_XREF ON (tv.ID=tvax.VENUE_ID) LEFT JOIN

Re: Left Join Help SOLVED

2006-06-23 Thread Paul Nowosielski
Thank you all so much for your help, here is my solution: (I'm sure I can do a little more optimization) SELECT DISTINCT (td.td_id) ,td.venue_id as ven_id, td.td_date as td_date, art.NAME as art_name,art.WEB as art_url, artd.artist_id as art_id, tv.ID, tv.NAME as ven_name, tv.ADDR1 ven_add0,

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_id =

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 LEFT

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

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 when I did

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

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

left join help

2003-07-09 Thread Rick Pasotto
One of these days I will maybe understand... Using MYSQL 4.0.13, debian linux create table members ( id unsigned int autoincrement, name ) create table activity ( id unsigned int autoincrement, description ) create table history ( id unsigned in

Re: left join help

2003-07-09 Thread Bruce Feist
Rick Pasotto wrote: One of these days I will maybe understand... A left join (t1 LEFT JOIN t2 ON condition) is defined as follows. For each row in t1, find all matching rows in t2 and return the combination of t1 and t2 found. If there are no t2s for a t1, leave the t2 values NULL in the