Re: Many to many to too many relation.

2008-09-30 Thread Rob Wultsch
Responses inline... On Tue, Sep 30, 2008 at 9:21 AM, Weston, Craig (OFT) <[EMAIL PROTECTED]> wrote: > > Rob, > I tried this on the small test data, a larger data set and it appears to > make my day. I sincerely appreciate your willingness to help me out. > > I do have some questions, mostly so I c

RE: Many to many to too many relation.

2008-09-30 Thread Weston, Craig (OFT)
k you. -Original Message- From: Rob Wultsch [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 10:11 AM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: Many to many to too many relation. Luck for you my vpn appears to be screwed up. Here is a stored proc I whipp

RE: Many to many to too many relation.

2008-09-30 Thread Weston, Craig (OFT)
Wow, I do feel very lucky. I am only at the "this is a cursor" part. I sincerely appreciate your help. -Original Message- From: Rob Wultsch [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 10:11 AM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: R

Re: Many to many to too many relation.

2008-09-30 Thread Rob Wultsch
> From: Rob Wultsch [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 30, 2008 3:30 AM > To: Weston, Craig (OFT) > Cc: mysql@lists.mysql.com > Subject: Re: Many to many to too many relation. > > I tried reading this and it took much brain power to do for free. I >

Re: Many to many to too many relation.

2008-09-30 Thread Rob Wultsch
his e-mail or its > attachments. Please notify the sender immediately by reply e-mail and > delete the e-mail from your system. > > > -Original Message- > > From: Rob Wultsch [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 30, 2008 3:30 AM > To: Weston, Crai

Re: Many to many to too many relation.

2008-09-30 Thread Peter Brawley
from your system. -Original Message- From: Rob Wultsch [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 3:30 AM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: Many to many to too many relation. I tried reading this and it took much brain power to do for free. I

RE: Many to many to too many relation.

2008-09-30 Thread Weston, Craig (OFT)
, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: Many to many to too many relation. I tried reading this and it took much brain power to do for free. I suggest breaking this down into the simplest possible example you can. Ideally have an create table statement, and insert with a small amount of

Re: Many to many to too many relation.

2008-09-30 Thread Rob Wultsch
I tried reading this and it took much brain power to do for free. I suggest breaking this down into the simplest possible example you can. Ideally have an create table statement, and insert with a small amount of data (as simple as possible), a simple psuedo code query and example output of what yo

Re: Many-to-many query (chained)

2007-09-29 Thread Rapthor
Great! With a little adaption it works! Yes and of course I have to use another name for groups :) It was just an example. I have slightly different table settings. SELECT u.name FROM user u JOIN user_role ur ON u.id=ur.user_id AND (ur.role_id=1 OR ur.role_id=2) JOIN user_group ug ON u.id=ug.user

Re: Many-to-many query (chained)

2007-09-29 Thread Peter Brawley
Rapthor, Try ... SELECT u.name FROM user u JOIN user_role ur ON u.id=ur.user_id AND (u.id=1 OR u.id=2) JOIN user_group ug ON u.id=ug.user_id AND (u.id=1 OR u.id=2) HAVING COUNT( DISTINCT ur.role_id ) = 2 AND COUNT( DISTINCT ug.group_id ) = 2; BTW you can't name a table 'group'; it's a reserve

Re: many to many

2005-04-21 Thread Rhino
I'm not sure if you're a novice to databases in general or just MySQL but if you aren't quite sure what a join is, I suspect you must be new to relational databases in general. In that case, may I recommend that you seriously consider devoting some time to learn SQL? This is the language used by a

Re: many to many

2005-04-20 Thread Simon Garner
On 21/04/2005 3:36 p.m., Perry Merritt wrote: Hi, I'm a novice. Hi Perry, I've designed a database that supports many to many relationships (actually many to many to many) and I need help creating the query to find my data. I know things like JOINs exist, but don't have a clue how to use them.

Re: many to many

2005-04-20 Thread Kim Briggs
An answer won't make much sense if you truly don't have a clue. W3schools has a good intro on joins. http://www.google.com/search?hl=en&q=sql+join+syntax&btnG=Google+Search cheers, KB On 4/20/05, Perry Merritt <[EMAIL PROTECTED]> wrote: > Hi, I'm a novice. > > I've designed a database that sup

Re: many-to-many query

2004-10-29 Thread Rhino
- Original Message - From: "Emily Lena Jones" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, October 28, 2004 7:46 PM Subject: Re: many-to-many query > > Quoting Rhino <[EMAIL PROTECTED]>: >

Re: many-to-many query

2004-10-28 Thread Emily Lena Jones
Quoting Rhino <[EMAIL PROTECTED]>: > I wasn't sure if you understood the concept of association tables so forgive > me if I told you things you already knew; I didn't mean to be patronizing. No problem--you weren't patronizing at all, and I did tell you I was new at this! > With respect to you

Re: many-to-many query

2004-10-28 Thread Rhino
- Original Message - From: "Emily Lena Jones" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 28, 2004 4:05 PM Subject: many-to-many query > Hi, I'm totally new at this so have no idea whether I'm asking for something > easy or quite difficult. > > I am working in My

Re: Many to Many: Does this make sense ?

2004-08-28 Thread Rhino
IL PROTECTED]> Sent: Saturday, August 28, 2004 6:08 PM Subject: Re: Many to Many: Does this make sense ? > Okay, hopefully I'm somewhat clearer today. I doubt > it but the effort is going to be made regardless. > > First off, Rhino I read through your last post, > regardin

Re: Many to Many: Does this make sense ?

2004-08-28 Thread Stuart Felenstein
f you have definitely abandoned > it. Maybe we can critique > that design for you and help you improve it or at > least avoid the most > common pitfalls. > > Rhino > > > > > - Original Message - > From: "Stuart Felenstein" <[EMAIL PROTECTED]>

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Shawn
As for the RAD tool I'm open to suggestions, but I think I've read about them all. PHP - MySQL platform. Does it have to be PHP? If a java RAD is ok I would suggest http://jdbforms.sourceforge.net/ It does not allow multiple inserts from one page, BUT you can: 1) tack in some html (text area o

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
From: "Stuart Felenstein" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; "Stuart Felenstein" <[EMAIL PROTECTED]> Sent: Friday, August 27, 2004 4:47 PM Subject: Re: Many to Many: Does this make se

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
uart Felenstein" <[EMAIL PROTECTED]> > To: "Rhino" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]>; "Stuart Felenstein" > <[EMAIL PROTECTED]> > Sent: Friday, August 27, 2004 3:05 PM > Subject: Re: Many to

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
My replies are interspersed below. Rhino - Original Message - From: "Stuart Felenstein" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; "Stuart Felenstein" <[EMAIL PROTECTED]>

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
issues for many years now. > > Rhino > > - Original Message - > From: [EMAIL PROTECTED] > To: Rhino > Cc: [EMAIL PROTECTED] ; Stuart Felenstein > Sent: Friday, August 27, 2004 2:05 PM > Subject: Re: Many to Many: Does this make sense ? > >

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
s the way we've been handling those issues for many years now. Rhino - Original Message - From: [EMAIL PROTECTED] To: Rhino Cc: [EMAIL PROTECTED] ; Stuart Felenstein Sent: Friday, August 27, 2004 2:05 PM Subject: Re: Many to Many: Does this make sense ? Rhino,

Re: Many to Many: Does this make sense ?

2004-08-27 Thread SGreen
Rhino, You and I are on the same page. I also never seen a "true many-to-many" relationship in database design. The closest approximation I have seen is the 3 table design like you and I have both proposed. It's the only way I have ever seen to model a many-to-many design, that's why I called

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
I don't think M2M or 12M make total sense > to > > me. I'm not sure about the interim table. A > query > > with some joins would net back the same results. > What > > I think is it's necessary to the 12M process. > > > > Thank you, > >

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
My remarks are interspersed below for reasons which will probably be obvious. Rhino - Original Message - From: [EMAIL PROTECTED] To: Stuart Felenstein Cc: [EMAIL PROTECTED] ; Peter Brawley ; Rhino Sent: Friday, August 27, 2004 12:33 PM Subject: Re: Many to Many: Does this

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
is the way it is. Rhino - Original Message - From: "Stuart Felenstein" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]>; "Peter Brawley" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, August 27, 2004 11:47 AM Subject: Re: Many t

Re: Many to Many: Does this make sense ?

2004-08-27 Thread SGreen
cess. > > Thank you, > Stuart > > --- Rhino <[EMAIL PROTECTED]> wrote: > > > > > ----- Original Message - > > From: "Stuart Felenstein" <[EMAIL PROTECTED]> > > To: "Peter Brawley" > > <[EMAIL PROTECTED]>; &g

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
ROTECTED]> wrote: > > - Original Message - > From: "Stuart Felenstein" <[EMAIL PROTECTED]> > To: "Peter Brawley" > <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Friday, August 27, 2004 10:06 AM > Subject: Re: Many to Ma

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
- Original Message - From: "Stuart Felenstein" <[EMAIL PROTECTED]> To: "Peter Brawley" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, August 27, 2004 10:06 AM Subject: Re: Many to Many: Does this make sense ? > Thank you for the "

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
Thank you for the "stop" sign. As for the RAD tool I'm open to suggestions, but I think I've read about them all. PHP - MySQL platform. Stuart --- Peter Brawley <[EMAIL PROTECTED]> wrote: > Stuart, > > >I'm using a RAD > >tool. Meaning it's point and click on fields and > >tables and the c

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Peter Brawley
Stuart, >I'm using a RAD >tool. Meaning it's point and click on fields and >tables and the code is generated automagically. The >one problem I've run into is the RAD tool doesn't have >the auto capabilities to allow multiple insert >transactions into the same table on one "page". To >allow 5 tit

Re: [MANY to MANY] relationship with MySQL ???

2002-04-17 Thread =d0Mi=
but i'm 97% that it works... ofcource You have to modify the query to match Your DB layout =d0Mi= - Original Message - From: "Matthew Smith" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]> Sent: Thursday, April 18, 2002 8:04 AM Subject: Re: [MANY

Re: [MANY to MANY] relationship with MySQL ???

2002-04-17 Thread Matthew Smith
Hi Robbie Reading what I wrote wasn't very clear to me either ;-) > How does song_x_artist reference the other databases? Is there a way to set > up a field to always be a reference to another table? I think you may be talking foreign keys here - something yet to come in MySQL AFAIK. > >

Re: [MANY to MANY] relationship with MySQL ???

2002-04-17 Thread Robbie Newton
> ...So the table song_x_artist contains references to all artists in a > song and vice-versa. (Field names correspond between tables.) How does song_x_artist reference the other databases? Is there a way to set up a field to always be a reference to another table? I am not quite sure what you

Re: [MANY to MANY] relationship with MySQL ???

2002-04-17 Thread Arthur Fuller
This is the classic case for a junction table (aka bridge table, associative table). It sits between Artists and Songs; let's call it PlaysOn. Artists: ArtistID: autoincrement ArtistName: varchar DOB: date etc. Songs: SongID: autoincrement SongName: varchar Duration: in seconds, say etc. PlaysO

Re: [MANY to MANY] relationship with MySQL ???

2002-04-17 Thread Matthew Smith
Hi Robbie, all I have lots of things that need many to many - the way that I do it is this: create table artists ( a_ser int unsigned not null primary key auto_increment, artist_name varchar(64), other stuff... ); create table songs ( s_ser int unsigned not null primary key auto_increment,

Re: many to many join on 2 tables.

2001-07-16 Thread Cal Evans
These two statements say the same thing. They shouldn't cause a problem but the probably don't do what you want. Try using the first table multiple times and use an alias. Don't have my book handy but it seems to me that : Select table1.*, table2.* from table1 as t1, table1 as t11, table 2 as t