RE: Multiple joins from same table?

2009-12-12 Thread Terry Van de Velde
-0987 -Original Message- From: shawn.gr...@sun.com [mailto:shawn.gr...@sun.com] Sent: December 12, 2009 4:39 PM To: Terry Van de Velde Cc: mysql@lists.mysql.com Subject: Re: Multiple joins from same table? Terry Van de Velde wrote: > Good Day, > > I am attempting to do something new (to

Re: Multiple joins from same table?

2009-12-12 Thread Shawn Green
Terry Van de Velde wrote: Good Day, I am attempting to do something new (to me) with MySQL. I am looking to have my query return with the value in the visitor and home columns replaced with the corresponding team name from the teams table. schedule.visitor and schedule.home are essentially fore

Re: Multiple joins from same table?

2009-12-10 Thread Gary Smith
Terry Van de Velde wrote: Good Day, I am attempting to do something new (to me) with MySQL. I am looking to have my query return with the value in the visitor and home columns replaced with the corresponding team name from the teams table. schedule.visitor and schedule.home are essentially

Multiple joins from same table?

2009-12-10 Thread Terry Van de Velde
Good Day, I am attempting to do something new (to me) with MySQL. I am looking to have my query return with the value in the visitor and home columns replaced with the corresponding team name from the teams table. schedule.visitor and schedule.home are essentially foreign keys to teams.team_no

RE: Complex SQL for multiple joins

2006-08-31 Thread Robert DiFalco
; mysql@lists.mysql.com Subject: Re: Complex SQL for multiple joins Also, depending on the number of permissions you are tracking, you could use a single INT field and do bitwise ORing in your application to determine permission checks... Though I usually don't recommend denormalizing the sch

Re: Complex SQL for multiple joins

2006-08-31 Thread Jay Pipes
of those should work. I don't know your table structure, so I can't > get too specific with it. > > - Original Message - > From: "Stephen Orr" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, August 30, 2006 7:27 PM > Subject: Complex SQL f

Re: Complex SQL for multiple joins

2006-08-31 Thread Brent Baisley
0, 2006 7:27 PM Subject: Complex SQL for multiple joins Hi, For my current website project I'm developing a fine-grained access control system. I have the schema mostly worked out, although it will be having additional data added to parts of it later. For the record, I have 6 tables:

Complex SQL for multiple joins

2006-08-30 Thread Stephen Orr
Hi, For my current website project I'm developing a fine-grained access control system. I have the schema mostly worked out, although it will be having additional data added to parts of it later. For the record, I have 6 tables: users (contains all my individual users) usergroups (contains all

Re: Multiple joins

2006-06-30 Thread Brent Baisley
ROTECTED]> To: Sent: Friday, June 30, 2006 10:30 AM Subject: Multiple joins What am I missing here? select m.*, d.discussion, d.discussion_id, u.user_id, t.topic_id from forums_messages left join forums_members m, forums_discussions d, users u, forums_topics t on m.topic_id = t.topic_id, t.discus

Re: Multiple joins

2006-06-30 Thread Steffan A. Cline
4 -0500 > To: "Steffan A. Cline" <[EMAIL PROTECTED]> > Cc: > Subject: Re: Multiple joins > > Steffan A. Cline wrote: >> What am I missing here? >> >> select m.*, d.discussion, d.discussion_id, u.user_id, t.topic_id >> from forums_messages

Re: Multiple joins

2006-06-30 Thread Gerald L. Clark
uot;1"; Is it legal to do multiple joins like this? Thanks Steffan forum_messages does not take part in any selection or any where clause. You have 5 tables listed, with only 4 of them appearing in 2 disjointed, and improperly formed joins. From the comma separated table list after a LE

Multiple joins

2006-06-30 Thread Steffan A. Cline
egal to do multiple joins like this? Thanks Steffan --- T E L 6 0 2 . 5 7 9 . 4 2 3 0 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 Steffan A. Cline [EMAIL PROTECTED] Phoenix, Az http://www.Execu

Re: query help-multiple joins

2006-05-23 Thread mel list_php
l.com Subject: Re: query help-multiple joins Date: Tue, 23 May 2006 13:16:33 +0200 Hi, I guess you should be able to do something like: SELECT t1.term_id, t1.name, r.type_id, t2.term_id, t2.name FROM term t1 LEFT JOIN relationTerm r ON r.term_id1 = t1.term_id LEFT JOIN term t2 ON r.term_id2 = t2.ter

Re: query help-multiple joins

2006-05-23 Thread Johan Höök
Hi, I guess you should be able to do something like: SELECT t1.term_id, t1.name, r.type_id, t2.term_id, t2.name FROM term t1 LEFT JOIN relationTerm r ON r.term_id1 = t1.term_id LEFT JOIN term t2 ON r.term_id2 = t2.term_id /Johan mel list_php skrev: Hi! I'm stuck with a join query 2 tables

query help-multiple joins

2006-05-23 Thread mel list_php
Hi! I'm stuck with a join query 2 tables, term and relation, the first one with definition of terms the second one with the relations between them. CREATE TABLE `term` ( `term_id` int(11) unsigned NOT NULL auto_increment, `name` varchar(250) default NULL, ) ENGINE=MyISAM DEFAULT CHARSET

multiple JOINs / GROUP BY (beginnrer) question

2005-08-15 Thread ktmpyah
Hello. I am trying to obtain a list of products and related information from three tables using JOINs and GROUP BY. my tables look like this: products: id: int name varchar ratings: user_id int product_id int rating int wishlists: user_id int product_id int stars int And I want th

Re: Multiple JOINs

2004-09-01 Thread Marko Knezevic
Rhino wrote: > Okay, you've convinced me that you need some Left Joins ;-) > > I think you'll have to use a mix of Left Joins and Inner Joins. In > the cases where you need a row even if something doesn't exist, like > a subject who has an address but no phone number, use a Left Join. In > any cas

Re: Multiple JOINs

2004-08-31 Thread Rhino
- Original Message - From: "Marko Knezevic" <[EMAIL PROTECTED]> To: "MySQL list" <[EMAIL PROTECTED]>; "Rhino" <[EMAIL PROTECTED]> Sent: Tuesday, August 31, 2004 6:11 PM Subject: Re: Multiple JOINs > Rhino wrote: > > > Your des

Re: Multiple JOINs

2004-08-31 Thread Marko Knezevic
Rhino wrote: > Your design seems fine, although you haven't explained how the field > and field_lookup tables join to the others so I am making some > assumptions. Table field_lookup has two values defined as primary keys: ID_company and ID_field Thus, using simple query like: SELECT company.nam

Re: Multiple JOINs

2004-08-31 Thread Rhino
- Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Cc: "Marko Knezevic" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, August 31, 2004 4:17 PM Subject: Re: Multiple

Re: Multiple JOINs

2004-08-31 Thread Michael Stassen
Rhino wrote: - Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> Rhino wrote: The other thing that strikes me as a possible problem is the '&&' operator in the last join. I mostly use DB2 but it doesn't have this operator so I'm not completely sure what '&&' will do in a MyS

Re: Multiple JOINs

2004-08-31 Thread Rhino
- Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Cc: "Marko Knezevic" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, August 31, 2004 3:46 PM Subject: Re: Multiple JOINs > &

Re: Multiple JOINs

2004-08-31 Thread Michael Stassen
Rhino wrote: The other thing that strikes me as a possible problem is the '&&' operator in the last join. I mostly use DB2 but it doesn't have this operator so I'm not completely sure what '&&' will do in a MySQL join. (I am familiar with the '&&' operator in programming languages, like Java, I'v

Re: Multiple JOINs

2004-08-31 Thread Rhino
- Original Message - From: "Marko Knezevic" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 31, 2004 12:53 PM Subject: Multiple JOINs > Hello, first i would like to greet all of you because i am new on this list. > > I am working on

Multiple JOINs

2004-08-31 Thread Marko Knezevic
Hello, first i would like to greet all of you because i am new on this list. I am working on yellowpages application and am having some problems. I have different tables for storing info about different companies, their addresses & phone numbers and their field of work (i can't remember exact word

multiple Joins and denormalizing

2003-06-26 Thread tlr7425
Actually, denormalizing aside, are multiple Joins or statements like... SELECT lastName, location, model, make FROM people, make, models, machines WHERE people.peopleID = machines.peopleID AND make.makeID = models.makeID AND models.modelID = machines.modelID ...common? I guess that's act

Multiple joins with aggregate problem

2002-07-23 Thread Yuri
I am having a or problem reproducible by script below (or by sql or by query if mail filter likes those words better:) ). Briefly: 4 tables joined to each other: /-ar a \-b-br I would expect to get totals based on the root record in a: a_idq_a q_arq_b q_br 1 1 4

Problem with multiple joins and/or aliasing

2002-06-27 Thread Dave Mark
The following is a neutered version of the query I am trying to run: SELECT TableA.Field1, TableA.Field2, TableA.Field3, TableB.Field4, TableA.Field5, TableC.Field6, TableA_1.Field3, TableB_1.Field4 FROM (TableB INNER JOIN ((TableA INNER JOIN TableA AS TableA_1 ON (TableA.Field1 = TableA_1.Field1

Re: multiple joins, order questions

2002-04-14 Thread DL Neil
> > > I'm quite sure it does not matter if I write > > > t_person.dperson_id = d_person.dperson_id AND > > > or > > > d_person.dperson_id = t_person.dperson_id AND > > > but please tell me if it does... :o) > > > > Logically there is no difference, however prevailing wisdom suggests > > th

RE: multiple joins, order questions

2002-04-14 Thread Roger Baklund
* DL Neil > > I'm quite sure it does not matter if I write > > t_person.dperson_id = d_person.dperson_id AND > > or > > d_person.dperson_id = t_person.dperson_id AND > > but please tell me if it does... :o) > > Logically there is no difference, however prevailing wisdom suggests > that you

Re: multiple joins, order questions

2002-04-14 Thread DL Neil
Hi Roger, > consider this select statement as an example: > > SELECT d_person.dispname, d_title.title > FROM d_person, d_title, s_first, s_last, t_person, l_first, l_last > WHERE > t_person.dperson_id = d_person.dperson_id AND > t_person.dtitle_id = d_title.dtitle_id AND > l_first

multiple joins, order questions

2002-04-12 Thread Roger Baklund
Hi, consider this select statement as an example: SELECT d_person.dispname, d_title.title FROM d_person, d_title, s_first, s_last, t_person, l_first, l_last WHERE t_person.dperson_id = d_person.dperson_id AND t_person.dtitle_id = d_title.dtitle_id AND l_first.fname_id = s_first.f

Re: request for help with multiple JOINs

2002-02-14 Thread DL Neil
Andreas, If anyone else is interested, I have solved the problem in stepwise/tutorial fashion below (best viewed using a fixed font). If anyone is skilled in the user of FROM...JOINs, (I'm sure Andreas, and) I'd welcome a critique/any improvements! I have taken a look at this problem, and bein

Re: Table appears in multiple joins returns null column

2002-02-14 Thread DL Neil
Keith, > I got it! What you said about replacing one JOIN with another is what did > the trick. After a little trial and error (maybe a little more than a > little) I got the results I needed. Thanks for the help. In case you're > still curious I am modeling short track racing here in New Yor

request for help with multiple JOINs

2002-02-13 Thread Andreas Habereder
Is there anyone who could help me with this "simple" query. Did i ask anything in a wrong way because I still got no answers to my request? SELECT at.name, av.value, at.unit, at.id, a.product_id FROM attribute_type at LEFT OUTER JOIN attribute a on (at.id = a.type_id) LEFT OUTER JOIN attrib

Re: Table appears in multiple joins returns null column

2002-02-12 Thread Andreas Habereder
Try to delete the index (drop index) of the table! I had the problem and solved this this way. regards, Andreas On Samstag, Februar 9, 2002, at 11:41 Uhr, DL Neil wrote: > Keith, > >> I have the below query that returns the correct records but the >> POINTFUND.description field is all NULL

RE: Table appears in multiple joins returns null column

2002-02-12 Thread Keith A. Calaman
ebruary 09, 2002 5:42 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Table appears in multiple joins returns null column Keith, > I have the below query that returns the correct records but the > POINTFUND.description field is all NULL while it has values in the table. &g

Re: Table appears in multiple joins returns null column

2002-02-12 Thread DL Neil
re values in POINTFUND.TYPE_ID that match TYPES.TYPE_ID. The obvious > solution to this is to create a query that joins POINTFUND and TYPES and > then use that query in the above query insead of the POINTFUND table (I hope > that makes sense). Unfortunatelly there doesn't seem t

Re: Table appears in multiple joins returns null column

2002-02-12 Thread DL Neil
Keith, > I have the below query that returns the correct records but the > POINTFUND.description field is all NULL while it has values in the table. > Any idea why? Thanks. > > SELECT > > RACES.RACE_ID, > RACES.sequence, > TYPES.typelong, > SCHEDULE.event, > SCHEDULE.date, > PARTY.lname, > POINT

Table appears in multiple joins returns null column

2002-02-12 Thread Keith A. Calaman
I have the below query that returns the correct records but the POINTFUND.description field is all NULL while it has values in the table. Any idea why? Thanks. SELECT RACES.RACE_ID, RACES.sequence, TYPES.typelong, SCHEDULE.event, SCHEDULE.date, PARTY.lname, POINTFUND.description FROM TYPES LE

Re: Table appears in multiple joins returns null column

2002-02-09 Thread Andreas Habereder
Try to delete the index (drop index) of the table! I had the problem and solved this this way. regards, Andreas On Samstag, Februar 9, 2002, at 11:41 Uhr, DL Neil wrote: > Keith, > >> I have the below query that returns the correct records but the >> POINTFUND.description field is all NULL

Re: Table appears in multiple joins returns null column

2002-02-09 Thread DL Neil
Keith, > I have the below query that returns the correct records but the > POINTFUND.description field is all NULL while it has values in the table. > Any idea why? Thanks. > > SELECT > > RACES.RACE_ID, > RACES.sequence, > TYPES.typelong, > SCHEDULE.event, > SCHEDULE.date, > PARTY.lname, > POINT

Table appears in multiple joins returns null column

2002-02-08 Thread Keith A. Calaman
I have the below query that returns the correct records but the POINTFUND.description field is all NULL while it has values in the table. Any idea why? Thanks. SELECT RACES.RACE_ID, RACES.sequence, TYPES.typelong, SCHEDULE.event, SCHEDULE.date, PARTY.lname, POINTFUND.description FROM TYPES LE

Re: Newbie: Multiple joins?

2001-02-09 Thread Bob Hall
t where I get all the users, that are in the same >groups as myself. How do I do this with multiple joins, when I can't do a >select in(select)? > > >Thanks in advance! > >Regards, >/Henrik Mohr Sir, I still haven't gotten MySQL set up again after my last Window

Newbie: Multiple joins?

2001-02-09 Thread Henrik Lebtien Mohr
same groups as myself. How do I do this with multiple joins, when I can't do a select in(select)? Thanks in advance! Regards, /Henrik Mohr - Before posting, please check: http://www.mysql.com/manual.php (the m