Join question

2008-10-16 Thread Chris W
I have two tables, one is a list of users and the other is a list of events for each user. It is a one to many relationship. The event table is pretty simple just an event type and a the date and time of the event in a datetime field. I need a query that shows all events of a certain type

Re: Join question

2008-10-16 Thread Gerald L. Clark
Chris W wrote: I have two tables, one is a list of users and the other is a list of events for each user. It is a one to many relationship. The event table is pretty simple just an event type and a the date and time of the event in a datetime field. I need a query that shows all events of a

Re: Join question

2008-10-16 Thread Chris W
I have no idea what I was thinking. For some reason I was thinking Distinct wouldn't work, must have been temporarily brain dead. Thanks for the wake up call. Gerald L. Clark wrote: Chris W wrote: I have two tables, one is a list of users and the other is a list of events for each user.

Join question

2008-07-31 Thread Andrej Kastrin
Dear all, I have two tables,let's call then a and b: Table a: CUI1|CUI2 C001|C002 C002|C003 C003|C055 C004|C002 ... Table b: CUI|STY C001|T001 C002|T002 C003|T003 C004|T004 C005|T006 C055|T061 .. And the join table should be: T001|T002 T002|T003 T003|T061 T004|T002 ... So,I should convert

Re: Join question

2008-07-31 Thread Jigal van Hemert
Dear all, I have two tables,let's call then a and b: Table a: CUI1|CUI2 C001|C002 C002|C003 C003|C055 C004|C002 ... Table b: CUI|STY C001|T001 C002|T002 C003|T003 C004|T004 C005|T006 C055|T061 .. And the join table should be: T001|T002 T002|T003 T003|T061 T004|T002

outer join question

2007-02-05 Thread KMiller
rows from 'a' regardless of the criteria 101 Any advice on how would I get only rows from 'a' that match 101 and any in 'b' that match if they exist? -km -- View this message in context: http://www.nabble.com/outer-join-question-tf3178361.html#a8819711 Sent from the MySQL - General mailing list

Re: outer join question

2007-02-05 Thread ViSolve DB Team
- Original Message - From: KMiller [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Tuesday, February 06, 2007 8:37 AM Subject: outer join question This query isn't what I want... select a.rhrqid,a.rhrqsid,a.rhrssid,b.sid,b.rlsid from rqhistory a left join relay b on a.rhrqsid = 101

Re: outer join question

2007-02-05 Thread KMiller
or a.rhrssid = 101 Thanks, ViSolve DB Team - Original Message - From: KMiller [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Tuesday, February 06, 2007 8:37 AM Subject: outer join question This query isn't what I want... select a.rhrqid,a.rhrqsid,a.rhrssid,b.sid

Re: 3 Table Join question

2006-06-25 Thread Graham Anderson
Solved it with Union :) SELECT images.id,images.name, playlist.title FROM images,playlist WHERE playlist.image_id = images.id UNION SELECT images.id,images.name, media.title FROM images,media WHERE media.image_id = images.id ORDER BY id ASC On Jun 23, 2006, at 6:44 PM, Graham Anderson

3 Table Join question

2006-06-23 Thread Graham Anderson
I am trying to build a query to 1) Get all the results from one table, 'images' 2) For each entry in the 'images' table, find the correct title from the 'playlist' OR 'media' table where images.id = which_table.images_id images table id, filename playlist table title images_id media table

join question

2006-01-05 Thread Terry Spencer
Hi All, I have a question for clearer brains than mine. I would like to join two tables,. There may be many possible joins in table B to table A, but I only want to join one row from B to table A - the row with the closest, but lesser date. TABLE A Row Id date 1 46 3 Jan 7

Re: join question

2006-01-05 Thread James Harvard
http://dev.mysql.com/doc/refman/4.1/en/example-maximum-column-group-row.html I'd translate it to your example, but it's bed-time here in England! HTH, James Harvard At 11:42 pm + 5/1/06, Terry Spencer wrote: I have a question for clearer brains than mine. I would like to join two tables,.

Re: basic sql join question...

2005-05-30 Thread mfatene
Hi Philip, what yoy called gand total is in @total for evevy row. you can just play : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; select @total as grand total; that's all ! Mathias Selon Philip George [EMAIL

Re: basic sql join question...

2005-05-30 Thread Philip George
On May 30, 2005, at 1:28 AM, [EMAIL PROTECTED] wrote: you can just play : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; select @total as grand total; works great. thanks very, very much. - philip -- MySQL General

Re: basic sql join question...

2005-05-30 Thread mfatene
re-send : Hi, you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+--+---+ | name | price | quantity | subtotal | @total:[EMAIL

Re: basic sql join question...

2005-05-29 Thread Jochem van Dieten
On 5/29/05, Philip George [EMAIL PROTECTED] wrote: +--++---+--+ | quantity | name | price | subtotal | +--++---+--+ |1 | orange | 0.97 | 0.97 | |3 | pear | 1.09 | 3.27 |

Re: basic sql join question...

2005-05-29 Thread Philip George
On May 29, 2005, at 1:41 AM, Jochem van Dieten wrote: http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. - philip -- MySQL General Mailing List For list

Re: basic sql join question...

2005-05-29 Thread Jochem van Dieten
On 5/29/05, Philip George wrote: On May 29, 2005, at 1:41 AM, Jochem van Dieten wrote: http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. The join is irrelevant. Your join returns a

Re: basic sql join question...

2005-05-29 Thread Philip George
http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. actually i should say that there are no examples of SUM() or AVG() -- or any of the other GROUP BY functions --

Re: basic sql join question...

2005-05-29 Thread Philip George
The join is irrelevant. Your join returns a resultset and you can just pretent that resultset is a single table: SELECT field1, field2, field3 FROM (very complicated join) AS simpletable GROUP BY ... WITH ROLLUP Just copy-pate your join into this and fix the fieldnames. aaahhh okay, i'm

Re: basic sql join question...

2005-05-29 Thread Jochem van Dieten
On 5/29/05, Philip George wrote: On 5/29/05, Philip George wrote: On 5/29/05, Jochem van Dieten wrote: http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. actually

Re: basic sql join question...

2005-05-29 Thread Philip George
actually, i've decided this is sort of a moot point, since i can do this calculation in the client app. no sql required. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: basic sql join question...

2005-05-29 Thread mfatene
re-submitted : re-send : Hi, you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+--+---+ | name | price | quantity | subtotal

Re: basic sql join question...

2005-05-29 Thread Philip George
On May 29, 2005, at 2:34 PM, [EMAIL PROTECTED] wrote: you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+-- +---+ | name |

Re: basic sql join question...

2005-05-29 Thread mfatene
Hi, you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+--+---+ | name | price | quantity | subtotal | @total:[EMAIL PROTECTED] |

basic sql join question...

2005-05-28 Thread Philip George
is it okay to post a basic sql join question to this list? if not, please point me to a list for these types of questions. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: basic sql join question...

2005-05-28 Thread Philip George
: is it okay to post a basic sql join question to this list? if not, please point me to a list for these types of questions. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL

table join question

2005-03-29 Thread Rob Brooks
Although I didn't find it in the docs anywhere, I know from experience that you cannot join more than 31 tables in 4.0.21 I was wondering if anybody knew if this limit has changed in version 5 Thx Rob

RE: table join question

2005-03-29 Thread Kevin Cowley
PROTECTED] Sent: 29 March 2005 15:57 To: 'MySQL list' Subject: table join question Although I didn't find it in the docs anywhere, I know from experience that you cannot join more than 31 tables in 4.0.21 I was wondering if anybody knew if this limit has changed in version 5

RE: Yet another LEFT JOIN question

2004-12-06 Thread Gordon
: Ron Gilbert [mailto:[EMAIL PROTECTED] Sent: Saturday, December 04, 2004 2:09 PM To: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Yet another LEFT JOIN question I have three tables, 'Ads' is a list of ads, 'Clicks' is a simple list of every time a Ad was clicked on with the Ads ID, and 'Views

Yet another LEFT JOIN question

2004-12-06 Thread Bill Easton
the clicks, then left join that with the views. HTH Bill From: Ron Gilbert [EMAIL PROTECTED] Subject: Yet another LEFT JOIN question Date: Sat, 4 Dec 2004 12:08:43 -0800 I have three tables, 'Ads' is a list of ads, 'Clicks' is a simple list of every time a Ad was clicked on with the Ads ID

Re: Yet another LEFT JOIN question

2004-12-06 Thread Ron Gilbert
a subquery to count the clicks, then left join that with the views. HTH Bill From: Ron Gilbert [EMAIL PROTECTED] Subject: Yet another LEFT JOIN question Date: Sat, 4 Dec 2004 12:08:43 -0800 I have three tables, 'Ads' is a list of ads, 'Clicks' is a simple list of every time a Ad was clicked

Re: Yet another LEFT JOIN question

2004-12-06 Thread Bill Easton
PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, December 06, 2004 11:05 AM Subject: Re: Yet another LEFT JOIN question If you are using 4.1 or later, you could do a subquery to count the clicks, then left join that with the views. I am using 4.1. I tried to do a sub-query, but never got

Yet another LEFT JOIN question

2004-12-04 Thread Ron Gilbert
I have three tables, 'Ads' is a list of ads, 'Clicks' is a simple list of every time a Ad was clicked on with the Ads ID, and 'Views' is a simple list of views that ad got, with the Ads ID. I am trying to SELECT a list of all the ads, with a count for clicks and a count for views, but my LEFT

left join question

2004-10-14 Thread Richard Reina
Is it possible to do two left joins involving three tables in one query? select a.id, a.amount FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) then LEFT JOIN t3 ON (t1.id=t3.id) Is this even possible? Any help would be greatly appreciated. Richard -- MySQL General Mailing List For list archives:

RE: left join question

2004-10-14 Thread Jay Blanchard
[snip] Is it possible to do two left joins involving three tables in one query? select a.id, a.amount FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) then LEFT JOIN t3 ON (t1.id=t3.id) Is this even possible? [/snip] Yes, and the keys from table to table don't have to be the same, save for each JOIN..

Re: left join question

2004-10-14 Thread Rhino
- Original Message - From: Richard Reina [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 14, 2004 8:26 AM Subject: left join question Is it possible to do two left joins involving three tables in one query? select a.id, a.amount FROM t1 LEFT JOIN t2 ON (t1.id=t2.id

update/join question..

2004-09-14 Thread bruce
hi... a question on how to do an update on a table that depends on 'left/right' joins with other tables... i have the following select that works. select u1.urltype as type, p1.fileID as fileID, l1.process as process, l1.status as status from university_urlTBL as u1 right join parsefileTBL as

Re: update/join question..

2004-09-14 Thread Rhino
- Original Message - From: bruce [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 11:45 AM Subject: update/join question.. hi... a question on how to do an update on a table that depends on 'left/right' joins with other tables... i have the following

Re: update/join question..

2004-09-14 Thread SGreen
chest. :-D Shawn Green Database Administrator Unimin Corporation - Spruce Pine Rhino [EMAIL PROTECTED] wrote on 09/14/2004 01:24:19 PM: - Original Message - From: bruce [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 11:45 AM Subject: update/join

Re: update/join question..

2004-09-14 Thread SGreen
chest. :-D Shawn Green Database Administrator Unimin Corporation - Spruce Pine Rhino [EMAIL PROTECTED] wrote on 09/14/2004 01:24:19 PM: - Original Message - From: bruce [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 11:45 AM Subject: update/join

Re: update/join question..

2004-09-14 Thread Oliver Schiessl
] To: [EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 11:45 AM Subject: update/join question.. hi... a question on how to do an update on a table that depends on 'left/right' joins with other tables... i have the following select that works. select u1.urltype as type, p1.fileID as fileID

Fw: update/join question..

2004-09-14 Thread Rhino
Sorry, I meant to send this reply to the whole mailing list, not just to Shawn. Rhino - Original Message - From: Rhino [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 2:18 PM Subject: Re: update/join question.. Okay, I stand corrected. Apparently, MySQL

another left join question - multiple left join statements

2004-07-05 Thread bruce
my test tbls cattbl dogtbl birdtbl namename name id --- catid --- dogid id id so dogtbl.catid = cattbl.id birdtbl.dogid = dogtbl.id my question is how i can use left joins to produce the results set with the names of all three

Re: another left join question - multiple left join statements

2004-07-05 Thread John Hicks
On Monday 05 July 2004 12:28 pm, bruce wrote: my test tbls cattbl dogtbl birdtbl namename name id --- catid --- dogid id id so dogtbl.catid = cattbl.id birdtbl.dogid = dogtbl.id my question is how i can use left joins to

Re: another left join question - multiple left join statements

2004-07-05 Thread Eric Bergen
You only need to specify from tabel on the first table. Like this. select cattbl.name as cat, dogtbl.name as dog, birdtbl.name as bird from dogtbl left join cattbl on cattbl.id=dogtbl.catid left join birdtbl on birdtbl.dogid=dogtbl.id; -Eric On Mon, 5 Jul 2004 09:28:02 -0700, bruce [EMAIL

Join question

2004-06-03 Thread Chris Dietzler
Running 4.0.18 I am trying to run a query where the query gets the offer_ID of a certain customer from the offer table and displays in the results the offer_Name associated with the offer_ID. Right now the way the query is working it displays all the offers in the offer table regardless of the

Re: Join question

2004-06-03 Thread Josh Trutwin
On Thu, 3 Jun 2004 13:06:54 -0700 Chris Dietzler [EMAIL PROTECTED] wrote: Running 4.0.18 I am trying to run a query where the query gets the offer_ID of a certain customer from the offer table and displays in the results the offer_Name associated with the offer_ID. Right now the way the

Re: Join question

2004-06-03 Thread Josh Trutwin
On Thu, 3 Jun 2004 15:22:36 -0500 Josh Trutwin [EMAIL PROTECTED] wrote: Or in preferable INNER JOIN syntax which makes it easier to forget a JOIN condition: Oops - I meant harder to forget not easier to forget. Doh. SELECT c.cst_SiteID, c.cst_IDC, a.asset_ID, o.offer_ID, o.offer_Name

Join Question

2004-05-20 Thread Roger Counihan
Hi - I'm running 4.0.18, so I can't use subqueries. I need to run a query to get the sum of costs from multiple tables for a given master table. What I have right now which is clearly not going to work is: SELECT conveyor.serial, SUM(conveyorsupport.cost), SUM(conveyoraccessories.cost) from

Re: Outer join question

2004-01-20 Thread Diana Soares
First, you database design. You don't need to separate actresses from actors... Why do that? They are the same entity, a person, with only one different attribute: the genre. So, you should join them in one single table: Actors == act_id name genre ENUM('m','f') Then, the table DVD. If we

[Fwd: Re: Outer join question]

2004-01-20 Thread Diana Soares
Sorry, i meant gender, not genre. -Forwarded Message- First, you database design. You don't need to separate actresses from actors... Why do that? They are the same entity, a person, with only one different attribute: the genre. So, you should join them in one single table: Actors

Re: Outer join question

2004-01-20 Thread Craig A. Finseth
First, you database design. You don't need to separate actresses from actors... Why do that? They are the same entity, a person, with only one different attribute: the genre. So, you should join them in one single table: ... Actually, it is possible to be female and to be an

Outer join question

2004-01-19 Thread Bjorn Barton-Pye
Hi, I'm just getting into MYSQL after nearly 12 years away from relational databases and I'm trying to blow the cobwebs away. So please bear with me if this is a simple question! I am using a test database to teach myself MYSQL and am using my DVD collection as the subject. I have 3 tables in

Outer join question

2004-01-19 Thread Bjorn Barton-Pye
Hi, I'm just getting into MYSQL after nearly 12 years away from relational databases and I'm trying to blow the cobwebs away. So please bear with me if this is a simple question! I am using a test database to teach myself MYSQL and am using my DVD collection as the subject. I have 3

Re: Outer join question

2004-01-19 Thread daniel
So, can somebody please correct the following query (and explain the syntax) so that it will work please? (I haven't tried putting an outer join in it because I don't understand the syntax.) Select actr.name, acto.name, dvd.title from actresses actr, actors

Re: Outer join question

2004-01-19 Thread daniel
so soemthing like select * from dvd left join actresses actr on actr.actr_id=dvd.actr_id left join actors acto on acto.acto_id=dvd.acto_id or by dvd.title totally forgot, to get a really good query especially when you use Innodb it doesnt like null values on foreign keys, i'd setup a row in

Re: Outer join question

2004-01-19 Thread Jochem van Dieten
Bjorn Barton-Pye wrote: I am using a test database to teach myself MYSQL and am using my DVD collection as the subject. I have 3 tables in this example: Actresses === actr_id name Actors == acto_id name DVD == Title acto_id actr_id The acto_id and actr_id in the DVD table indicates the

Re: Outer join question

2004-01-19 Thread daniel
DVD_Actor: dvd_ID REFERENCES DVD actor_ID REFERNCES Actor Is this how you setup a join table ? what exactly is the references keyword ? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Outer join question

2004-01-19 Thread Jochem van Dieten
[EMAIL PROTECTED] wrote: DVD_Actor: dvd_ID REFERENCES DVD actor_ID REFERNCES Actor Is this how you setup a join table ? Yes. what exactly is the references keyword ? It indicates a foreign key. Full syntax is something like: dvd_ID CONSTRAINT dvc_fk FOREIGN KEY REFERENCES DVD (dvd_ID) Read the

Re: Outer join question

2004-01-19 Thread daniel
[EMAIL PROTECTED] wrote: DVD_Actor: dvd_ID REFERENCES DVD actor_ID REFERNCES Actor Is this how you setup a join table ? Yes. what exactly is the references keyword ? It indicates a foreign key. Full syntax is something like: dvd_ID CONSTRAINT dvc_fk FOREIGN KEY REFERENCES DVD

Self Join question - large table

2003-11-25 Thread Henry Hank
Hello, I have a query that will be used alot on my website that involves a 42 million record table being self-joined. The primary table instance will be limited by an index resulting in 1 to about 50,000 rows being selected, then joined to the second instance of the table, which will retrieve

Re: Self Join question - large table

2003-11-25 Thread Brent Baisley
Absolutely not. First, you have the overhead of maintaining the two tables. Second, MySQL doesn't know that they are identical tables, so it will try to cache both of them. On a self join, MySQL does know they are identical, so it will only need to load the data into memory once. If there is

ALTER TABLE z ADD INDEX... Speed: Follow up to LEFT JOIN question

2003-10-15 Thread D. R. Hansen
What amount of time is reasonable to expect for indexing an FK int field on a simple table with about 30K records. It's running on my learning machine -- an aging Pentium 5/133 box running RH 8 which is ordinarily quite fast enough for my purposes. It's been running about six hours now, and

Re: ALTER TABLE z ADD INDEX... Speed: Follow up to LEFT JOIN question

2003-10-15 Thread Matt W
things...), then it's not hung. Just sit and wait. :-) Matt - Original Message - From: D. R. Hansen Sent: Wednesday, October 15, 2003 3:39 PM Subject: ALTER TABLE z ADD INDEX... Speed: Follow up to LEFT JOIN question What amount of time is reasonable to expect for indexing an FK int

Re: ALTER TABLE z ADD INDEX... Speed: Follow up to LEFT JOIN question

2003-10-15 Thread Dan Hansen
PM Subject: ALTER TABLE z ADD INDEX... Speed: Follow up to LEFT JOIN question What amount of time is reasonable to expect for indexing an FK int field on a simple table with about 30K records. It's running on my learning machine -- an aging Pentium 5/133 box running RH 8 which is ordinarily

LEFT JOIN question

2003-09-13 Thread Mike Hillyer
Hi all; I was given a query today of the following: SELECT record_id, record_title,artist_name,label_name,record_catalog FROM record_profile LEFT JOIN artist_profile,label_profile ON record_profile.artist_id = artist_profile.artist_id OR record_profile.label_id = label_profile.label_id GROUP BY

Join question

2003-06-06 Thread Anthony Ward
Hi, I have posted a similar question, but can't find the answers. I'm sorry. What i'm trying to do is that i have 3 tables each has three columns and are indexed. so I want to do something like select everything in 3 tables and display only similar id. Select id from table1 where table1.cl1 =

RE: Join question

2003-06-06 Thread Mike Hillyer
are looking for, otherwise let us know. Regards, Mike Hilyer www.vbmysql.com -Original Message- From: Anthony Ward [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:17 PM To: [EMAIL PROTECTED] Subject: Join question Hi, I have posted a similar question, but can't find

Re: Join question

2003-06-06 Thread Peter Brawley
.distance BETWEEN 1 and 99; HTH PB - Original Message - From: Anthony Ward To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:17 PM Subject: Join question Hi, I have posted a similar question, but can't find the answers. I'm sorry. What i'm trying to do is that i have 3

Re: Join question

2003-06-06 Thread Anthony Ward
Hi, what is the difference between your way and Mike Hillyer way?? (I can see the INNER join). But thanx to both of you. Anthony -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Join question

2003-06-06 Thread Mike Hillyer
To: [EMAIL PROTECTED] Subject: Re: Join question Hi, what is the difference between your way and Mike Hillyer way?? (I can see the INNER join). But thanx to both of you. Anthony -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com

Re: Join question

2003-06-06 Thread Peter Brawley
: Anthony Ward To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:53 PM Subject: Re: Join question Hi, what is the difference between your way and Mike Hillyer way?? (I can see the INNER join). But thanx to both of you. Anthony -- MySQL General Mailing List For list

Re: embedded select / left join question

2003-03-30 Thread Jim Miller
That does it! Thanks much. Jim On Saturday, March 29, 2003, at 06:14 PM, Bruce Feist wrote: Jim Miller wrote: I want to do a join and select of these tables that will give me all the Entrants who did NOT enter contest 1 (i.e., Mary and Bill). Try: select entrant.name from entrant

Re: embedded select / left join question

2003-03-29 Thread Bruce Feist
Jim Miller wrote: I want to do a join and select of these tables that will give me all the Entrants who did NOT enter contest 1 (i.e., Mary and Bill). Try: select entrant.name from entrant left join contestEntries on entrant.id = contestEntries.entrant AND

embedded select / left join question

2003-03-28 Thread Jim Miller
This is probably a real newbie question, but, since that's what I am... Using MySQL 3.23, I have two tables, for instance: ContestEntries: id, entrant, contestNumber, etc. Entrant: id, name, etc. There are multiple contests, and Entrants can enter as many as they like. So,

Join Question

2003-03-27 Thread Charles Kline
I have two tables. tbl_reports and tbl_personnel tbl_reports has these fields: rep_id, person1, person2, person3, person 4 tbl_personnel has these fields: per_id, fname, lname, mname What is the way to get each report back once, and have the fname, mname, and lname fields available to print

Re: Join Question

2003-03-27 Thread Bruce Feist
Usually it's best to work with normalized tables, which would make this trivial. tbl_reports isn't normalized, since it has a simulated array of persons in it. Could it be split into two tables: tbl_reports, with fields: rep_id (primary key) and other report-specific information you didn't

Re: Join Question

2003-03-27 Thread alx
On Fri, 2003-03-28 at 01:39, Bruce Feist wrote: Usually it's best to work with normalized tables, which would make this trivial. tbl_reports isn't normalized, since it has a simulated array of persons in it. Could it be split into two tables: i'm interested on how to normalize a table... can

Re: Join Question

2003-03-27 Thread Bruce Feist
alx wrote: On Fri, 2003-03-28 at 01:39, Bruce Feist wrote: Usually it's best to work with normalized tables, which would make this trivial. tbl_reports isn't normalized, since it has a simulated array of persons in it. Could it be split into two tables: i'm interested on how to

Re: Desperate Sum(), Group by/Join question - One Step closer...

2003-03-12 Thread Roger Baklund
* Peter D Bethke Ok, in regards to my previous dilemma, I've gotten it to: SELECT golf_pick_periods.id, golf_pick_periods.period_name, golf_pick_periods.period_start_date, golf_pick_periods.period_end_date, COUNT(DISTINCT golf_events.id) AS num_events,

Desperate Sum(), Group by/Join question

2003-03-11 Thread Peter D Bethke
Hi all, I've got a mysql application that tracks golf events where players pick winners. Each event is associated by date with a pick period (ie a month). I'm trying to get a COUNT() function to count all the picks by pick period for a given player (in this case id = 1). The following SQL:

Desperate Sum(), Group by/Join question

2003-03-11 Thread Peter D Bethke
Hi all, I've got a mysql application that tracks golf events where players pick winners. Each event is associated by date with a pick period (ie a month). I'm trying to get a COUNT() function to count all the picks by pick period for a given player (in this case id = 1). The following SQL:

Re: Desperate Sum(), Group by/Join question - One Step closer...

2003-03-11 Thread Peter D Bethke
Ok, in regards to my previous dilemma, I've gotten it to: SELECT golf_pick_periods.id, golf_pick_periods.period_name, golf_pick_periods.period_start_date, golf_pick_periods.period_end_date, COUNT(DISTINCT golf_events.id) AS num_events,

Re: Inner join question!

2003-02-28 Thread Ramesh Pillai
: Thursday, February 27, 2003 10:36 PM Subject: Inner join question! All, I have two tables like the following table A date num1 num2 time table B date num1 num2 time When I run a query like the following select * from A as a inner join B as b on a.num1 = b.num1 and a.date

Inner join question!

2003-02-27 Thread Ramesh Pillai
All, I have two tables like the following table A date num1 num2 time table B date num1 num2 time When I run a query like the following select * from A as a inner join B as b on a.num1 = b.num1 and a.date=b.date and a.num2=b.num2 and a.time=b.time I am getting the results repeated 4 times,

Re: Inner join question!

2003-02-27 Thread Tore Bostrup
Subject: Inner join question! All, I have two tables like the following table A date num1 num2 time table B date num1 num2 time When I run a query like the following select * from A as a inner join B as b on a.num1 = b.num1 and a.date=b.date and a.num2=b.num2 and a.time=b.time I am

Re: RE: Join-question

2002-12-06 Thread Victoria Reznichenko
the name for 'parentid'. NJ -joseph NJ -Original Message- NJ From: Victoria Reznichenko [mailto:[EMAIL PROTECTED]] NJ Sent: Thursday, December 05, 2002 9:01 AM NJ To: [EMAIL PROTECTED] NJ Subject: re: Join-question NJ Michelle, NJ Thursday, December 05, 2002, 5:46:03 PM, you wrote: MdB I

Re: Join-question

2002-12-05 Thread Roger Baklund
* Michelle de Beer I believe this question is solved by a join, but I haven't really got a hang of it. My table: -- | uid | rootid | parentid | name | -- | 1 | 0 | 0| name1| | 2 | 1 | 1

Re: Join-question

2002-12-05 Thread Ryan Fox
- Original Message - From: Michelle de Beer [EMAIL PROTECTED] I believe this question is solved by a join, but I haven't really got a hang of it. My table: -- | uid | rootid | parentid | name | -- | 1 |

Re: Join-question

2002-12-05 Thread Doug Thompson
Hi: You might find these articles from O'Reilly Network will help clear the water. http://www.onlamp.com/pub/ct/19 Doug On Thu, 5 Dec 2002 07:46:03 -0800 (PST), Michelle de Beer wrote: I believe this question is solved by a join, but I haven't really got a hang of it. My table:

Join-question

2002-12-05 Thread Michelle de Beer
I believe this question is solved by a join, but I haven't really got a hang of it. My table: -- | uid | rootid | parentid | name | -- | 1 | 0 | 0| name1| | 2 | 1 | 1| name2| | 3 |

re: Join-question

2002-12-05 Thread Victoria Reznichenko
Michelle, Thursday, December 05, 2002, 5:46:03 PM, you wrote: MdB I believe this question is solved by a join, but I MdB haven't really got a hang of it. MdB My table: MdB -- MdB | uid | rootid | parentid | name | MdB --

RE: Basic SQL join question

2002-09-24 Thread Arthur Fuller
obtained by keeping it in JOIN clauses and using the WHERE only to contain the include if logic. hth, Arthur -Original Message- From: Adam Randall [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 21, 2002 5:18 AM To: [EMAIL PROTECTED] Subject: Basic SQL join question Okay, I've

RE: Basic SQL join question

2002-09-24 Thread Josh Trutwin
PROTECTED]] Sent: Saturday, September 21, 2002 5:18 AM To: [EMAIL PROTECTED] Subject: Basic SQL join question Okay, I've thought about this every way I can conceive of, but I cannot figure out the sql query logic involved in joining three tables together. Here is what I am trying to do: I

Re: Basic SQL join question

2002-09-24 Thread Arthur Fuller
Subject: RE: Basic SQL join question SELECT * FROM Projects INNER JOIN KeywordLink ON Projects.Id = KeywordLink.Pid INNER JOIN Keywords KeywordLink.Kid = Keywords.Id WHERE Keyword LIKE '%historical%' AND Keyword like '%scenic%'; Out of curiousity, does the order matter? I have a JOIN

RE: Basic SQL join question

2002-09-24 Thread John Ragan
join question Okay, I've thought about this every way I can conceive of, but I cannot figure out the sql query logic involved in joining three tables together. Here is what I am trying to do: I have three tables: keywords keywordlink projects keywords has these fields

Basic SQL join question

2002-09-21 Thread Adam Randall
Okay, I've thought about this every way I can conceive of, but I cannot figure out the sql query logic involved in joining three tables together. Here is what I am trying to do: I have three tables: keywords keywordlink projects keywords has these fields: id keyword keywordlink has

JOIN-Question

2002-09-19 Thread Peter Stöcker
Hi there! I have a question on JOINs. First the system: table1: name: t1 entries: name field1 field2 test 1 2 test2 3 4 table2: name t2

Re: JOIN-Question

2002-09-19 Thread Mikhail Entaltsev
need exactly this resultset. Best regards, Mikhail. - Original Message - From: Peter Stöcker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 19, 2002 11:03 AM Subject: JOIN-Question Hi there! I have a question on JOINs. First the system: table1: name: t1

  1   2   >