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,
a
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, tv.A
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)
>L
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
rtist_id = art.PKEY AND td.venue_id=tv.ID)
LIMIT 500
- Original Message -
From: "Paul Nowosielski" <[EMAIL PROTECTED]>
To:
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.
Basical
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 (td.
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 ven
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_
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
* 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
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
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
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
Rick Pasotto wrote:
One of these days I will maybe understand...
A "left join" (t1 LEFT JOIN t2 ON ) 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 result.
Try
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 autoincre
15 matches
Mail list logo