Re: SELECT of records that have a matching record in a many to many table

2009-05-04 Thread Martijn Engler
: Can someone please help me with this one? I'm trying to SELECT from a table only those records that have a record, matching a search term, in a table related by a many to many relationship. The many to many relationship is in a mapping/junction table. Here's an example of what I have so far

SELECT of records that have a matching record in a many to many table

2009-04-30 Thread Nigel Peck
Can someone please help me with this one? I'm trying to SELECT from a table only those records that have a record, matching a search term, in a table related by a many to many relationship. The many to many relationship is in a mapping/junction table. Here's an example of what I have so far

Re: Many to many to too many relation.

2008-09-30 Thread Rob Wultsch
distinct value in the relation, no matter how many other members of the relation exist. Can anyone offer any suggestions? Here is some sample data to chew on. AB100674,MA003296 AB100675,MA003306 AB100676,MA003314 AB100677,MA003312 AB100678,MA003321 AB100679,MA003318

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

Re: Many to many to too many relation.

2008-09-30 Thread Peter Brawley
. -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 suggest breaking

Re: Many to many to too many relation.

2008-09-30 Thread Rob Wultsch
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 Rob Wultsch
, 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 suggest breaking this down into the simplest possible example you can. Ideally have an create

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: Re: Many

RE: Many to many to too many relation.

2008-09-30 Thread Weston, Craig (OFT)
. -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 whipped up

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 can

Many to many to too many relation.

2008-09-29 Thread Weston, Craig (OFT)
and non-exclusive, by which I mean that the data will always be in both columns, and it is possible that more than one relation exists. In the case of more than 1 relation I still need the just lowest distinct value in the relation, no matter how many other members of the relation exist

how: many-to-many with LEFT JOIN

2008-03-10 Thread dr_pompeii
requeriment was that a wonderful 1 CabeceraComprobanteVenta can sell/contain [b]many items[/b] ArticuloNoAuto (1-4) and 1 ArticuloNoAuto can be contained in 1 to 2 CabeceraComprobanteVenta (normal) or (canceled,newnormal) so we have a relation many-to-many already resolved by hibernate with a link

Counting number of associated many-to-many items

2007-10-26 Thread Robert MannI
many books he has worked on. 2. Select each author, and how many bestseller books (bestseller = 1) he has worked on. Not exactly sure how to do this, can someone help me out with this? Thank you, Rob -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe

Re: Counting number of associated many-to-many items

2007-10-26 Thread mysql
each author, and how many books he has worked on. SELECT a.id, a.name, COUNT(b.id) AS oeuvre FROM authors AS a LEFT JOIN authorships AS asp ON asp.author_id = a.id LEFT JOIN books AS b ON asp.book_id = b.id GROUP BY a.id; This will also take into account books whose authorship is shared. 2

Many-to-many query (chained)

2007-09-29 Thread Rapthor
Hi SQLers, I am searching for an SQL command to combine several many-to-many queries. At the end I only want to get results suitable for all restrictions. Better show you my tables: USER id name 1 frank ROLE id name 1 admin 2 general GROUP id name 1 groupA 2 groupB USER_ROLE

Re: Many-to-many query (chained)

2007-09-29 Thread Peter Brawley
a reserved word. PB - Rapthor wrote: Hi SQLers, I am searching for an SQL command to combine several many-to-many queries. At the end I only want to get results suitable for all restrictions. Better show you my tables: USER id name 1 frank ROLE id name 1 admin 2 general GROUP id name

Re: Many-to-many query (chained)

2007-09-29 Thread Rapthor
to combine several many-to-many queries. At the end I only want to get results suitable for all restrictions. Better show you my tables: USER id name 1 frank ROLE id name 1 admin 2 general GROUP id name 1 groupA 2 groupB USER_ROLE user_id role_id 1 1 1 2 USER_GROUP

select records not in a *particular* many-to-many relationship

2006-04-18 Thread Marco Carbone
Hey all, I've checked the archives and found an explanation as to how the check if a record is not in a many-to-many table. The answer to that is somewhat simple and clear to me. But here's my problem: how do you check if a record doesn't have a *particular* many-to-many relationship

Re: select records not in a *particular* many-to-many relationship

2006-04-18 Thread Peter Brawley
Marco, I've checked the archives and found an explanation as to how the check if a record is not in a many-to-many table. The answer to that is somewhat simple and clear to me. But here's my problem: how do you check if a record doesn't have a *particular* many-to-many relationship

Re: select records not in a *particular* many-to-many relationship

2006-04-18 Thread gerald_clark
I've checked the archives and found an explanation as to how the check if a record is not in a many-to-many table. The answer to that is somewhat simple and clear to me. But here's my problem: how do you check if a record doesn't have a *particular* many-to-many relationship

Re: select records not in a *particular* many-to-many relationship

2006-04-18 Thread Marco Carbone
gerald_clark wrote: I've checked the archives and found an explanation as to how the check if a record is not in a many-to-many table. The answer to that is somewhat simple and clear to me. But here's my problem: how do you check if a record doesn't have a *particular* many-to-many

Re: Find records not in many-to-many table?

2006-03-27 Thread sheeri kritzer
. I can't seem to find this anywhere, although I'm certain I've seen it before. How can I identify all the records in a table that are not referenced in a many-to-many table? I have a [unique] table of files and a [unique] table of attributes. These are linked in a merge table which

Re: Find records not in many-to-many table?

2006-03-26 Thread Stefan Kuhn
to find this anywhere, although I'm certain I've seen it before. How can I identify all the records in a table that are not referenced in a many-to-many table? I have a [unique] table of files and a [unique] table of attributes. These are linked in a merge table which is many

Find records not in many-to-many table?

2006-03-25 Thread barney
Folk, This may be off-base for this list, but I've run out of places to look, sorry. I can't seem to find this anywhere, although I'm certain I've seen it before. How can I identify all the records in a table that are not referenced in a many-to-many table? I have a [unique] table of files

Re: Find records not in many-to-many table?

2006-03-25 Thread Stefan Kuhn
, although I'm certain I've seen it before. How can I identify all the records in a table that are not referenced in a many-to-many table? I have a [unique] table of files and a [unique] table of attributes. These are linked in a merge table which is many-to-many. I need to find all items

Re: Find records not in many-to-many table?

2006-03-25 Thread barney
. I can't seem to find this anywhere, although I'm certain I've seen it before. How can I identify all the records in a table that are not referenced in a many-to-many table? I have a [unique] table of files and a [unique] table of attributes. These are linked in a merge table which

Re: Find records not in many-to-many table?

2006-03-25 Thread Peter Brawley
I've seen it before. How can I identify all the records in a table that are not referenced in a many-to-many table? I have a [unique] table of files and a [unique] table of attributes. These are linked in a merge table which is many-to-many. I need to find all items in the file table

Re: Find records not in many-to-many table?

2006-03-25 Thread Michael Stassen
barney wrote: Thanks, Stefan, But that only works if both tables have the same field name, doesn't it? If I use select FileKey from dl_files left join dl_merges using (FileID) where FileID is null MySQL returns Unknown column 'articles.dl_files.FileID' in 'on clause'. Correct me if I'm wrong,

Re: Find records not in many-to-many table?

2006-03-25 Thread barney
that are not referenced in a many-to-many table? I have a [unique] table of files and a [unique] table of attributes.  These are linked in a merge table which is many-to-many.  I need to find all items in the file table that are not referenced in the merge table in order to add appropriate attributes

Re: Multiple many-to-many SELECT

2006-02-13 Thread SGreen
with several tables related on a many-to-many basis. Here is a simplified description: TABLE: movies +-+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra

Re: Multiple many-to-many SELECT

2006-02-13 Thread SGreen
oops! I hit SEND before I was done. (BAD FINGERS!) SELECT * FROM movies LEFT JOIN director_movies ON director_movies.movie_id=movies.id LEFT JOIN director ON director_movies.director_id = director.id LEFT JOIN country_movies ON country_movies.movie_id=movies.id LEFT JOIN country

Re: Multiple many-to-many SELECT

2006-02-12 Thread Jessica Yazbek
the wrong keywords. In any event, I am desperate for help. Here is my problem: I have a database with several tables related on a many-to-many basis. Here is a simplified description: TABLE: movies +-+-+--+-+-+---+ | Field | Type

Re: Multiple many-to-many SELECT

2006-02-12 Thread Peter Brawley
a database with several tables related on a many-to-many basis. Here is a simplified description: TABLE: movies +-+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra

Fw: Multiple many-to-many SELECT

2006-02-12 Thread Rhino
Oops, I meant to send this to the list so that all could benefit. -- Rhino - Original Message - From: Rhino [EMAIL PROTECTED] To: Jessica Yazbek [EMAIL PROTECTED] Sent: Sunday, February 12, 2006 4:19 PM Subject: Re: Multiple many-to-many SELECT Assuming you are only worried about

Re: Multiple many-to-many SELECT

2006-02-10 Thread sheeri kritzer
Note the link at the bottom of that page to Data Modeling as part of Database Design. That whole site is really good, actually. -Sheeri On 2/9/06, Rhino [EMAIL PROTECTED] wrote: Jessica, It think your first mistake is that you are trying to implement many-to-many relationships directly

Re: Multiple many-to-many SELECT

2006-02-10 Thread Jessica Yazbek
each many-to-many relationship. The tables are as follows: movies director producer director_movies (relates director.id to movies.id) producer_movies (relates producer.id to movies.id) I'm hoping for a way to select movies.*, director.* and producer.* using only the movies.id field. I have

Multiple many-to-many SELECT

2006-02-09 Thread Jessica Yazbek
a database with several tables related on a many-to-many basis. Here is a simplified description: TABLE: movies +-+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra

Re: Multiple many-to-many SELECT

2006-02-09 Thread Rhino
Jessica, It think your first mistake is that you are trying to implement many-to-many relationships directly. Although it is theoretically possible to do so, I've never seen anyone do it myself. I believe the normal approach is to break each many-to-many relationship into two one-to-many

Re: many to many

2005-04-21 Thread Rhino
by all of the relational databases - and many non-relational databases as well - and it will pay you big dividends to know the language as you continue your work with MySQL. There are lots of ways to learn SQL: - online tutorials (just Google on 'SQL tutorial' and you should find a bunch) - books

many to many

2005-04-20 Thread Perry Merritt
Hi, I'm a novice. 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. I have three main tables and two link tables

Re: many to many

2005-04-20 Thread Kim Briggs
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. I have three main tables and two link tables, The main tables are A, B, and C. Each are defined with id INT

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 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]: I wasn't sure if you understood the concept of association tables

many-to-many query

2004-10-28 Thread Emily Lena Jones
with topic 36. Because I'm working in an earlier version of MySQL, I can't use a subquery. Any ideas/solutions/help would be most appreciated! Many thanks, Emily -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

many-to-many query

2004-10-28 Thread none none
http://dev.mysql.com/doc/mysql/en/JOIN.html -Original Message- From: Emily Lena Jones [mailto:[EMAIL PROTECTED] Sent: Thursday, October 28, 2004 1:05 PM To: [EMAIL PROTECTED] Subject: many-to-many query Hi, I'm totally new at this so have no idea whether I'm asking for something easy

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 MySQL

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 your

Re: Querying on subsets of one-to-many and many-to-many

2004-10-27 Thread Daniel BODEA
Subject: Re: Querying on subsets of one-to-many and many-to-many OK, now that I have a better model to work with, let me try again. (And stop being so discouraged! This is hard for everyone until they get the hang of it!!! =8-D ) Given a query that resembles this select * from A where (no links

Querying on subsets of one-to-many and many-to-many

2004-10-26 Thread Daniel BODEA
Greetings, I have several solutions to a problem which requires temporary or cache tables but the different solutions are time consuming to test for performance and I was wondering if anyone had more information on this than myself. The server is 3.23.40 without possibility for upgrade to 4.x

Re: Querying on subsets of one-to-many and many-to-many

2004-10-26 Thread SGreen
Under most circumstances, even with data tables as large as yours, I have found that direct JOIN statements have provided acceptable performance. On certain highly normalized databases, where the requirements of the query needed more than 4 or 5 tables joined at once, I have also used your

Re: Querying on subsets of one-to-many and many-to-many

2004-10-26 Thread Daniel BODEA
Many thanks for the quick answer. I apologize for leaving out a few details that should have explained the context in greater detail. I'll use less theory below to further explain what's going on and then I'll make some remarks on your answer. Simplified down to the basics of this problem, we

Re: Querying on subsets of one-to-many and many-to-many

2004-10-26 Thread SGreen
and rejects=0); This returns three more columns that you originally wanted but it's still a one-trip query. Shawn Green Database Administrator Unimin Corporation - Spruce Pine Daniel BODEA [EMAIL PROTECTED] wrote on 10/26/2004 11:55:34 AM: Many thanks for the quick answer. I apologize for leaving

how to optimize multiple many-to-many relationship related query

2004-10-18 Thread Elim Qiu
I have, to make it clear, 2 many-to-many relationships for table person: PersonPerson_Club ClubPerson_Creditcard CreditCard

Re: Many to Many: Does this make sense ?

2004-08-28 Thread Shawn
or whatever) to the generated pages allowing the user to enter as many titles as they are allowed to 2) get what the user has entered out of the response and write a wee bit of code to do the insertion (in what dbforms calls an interceptor). For example, in your case, I would create these tables

Re: Many to Many: Does this make sense ?

2004-08-28 Thread Stuart Felenstein
Message - 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 sense ? Let me answer the first part now

Re: Many to Many: Does this make sense ?

2004-08-28 Thread Rhino
My replies are interspersed with Stuart's note. Rhino - Original Message - From: Stuart Felenstein [EMAIL PROTECTED] To: Rhino [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; Stuart Felenstein [EMAIL PROTECTED] Sent: Saturday, August 28, 2004 6:08 PM Subject: Re: Many

Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
transactions into the same table on one page. To allow 5 titles I need 5 pages. From a users standpoint, it's not horrible, but not the best. So, now I'm podering a Many to Many, but I realize there would need to be multiple Member_Title tables, Member_Title1, Member_Title2, Member_Title3, etc

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Peter Brawley
need 5 pages. From a users standpoint, it's not horrible, but not the best. So, now I'm podering a Many to Many, but I realize there would need to be multiple Member_Title tables, Member_Title1, Member_Title2, Member_Title3, etc. Sounds like a dreadul idea, breaks several relational rules

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
podering a Many to Many, but I realize there would need to be multiple Member_Title tables, Member_Title1, Member_Title2, Member_Title3, etc. Sounds like a dreadul idea, breaks several relational rules and will make more problems down the road c. Why not lose the RAD tool, find a better one

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 stop sign. As for the RAD tool I'm open to suggestions

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
- 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 stop sign. As for the RAD tool I'm open to suggestions, but I think I've

Re: Many to Many: Does this make sense ?

2004-08-27 Thread SGreen
submits the multiple field input form, your handling code will need to go down the list of fields and make the appropriate database entries. 1 form with 5 fields. User is happy, database is happy. You have kept the user from entering too many choices because you only gave them as many fields as you

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
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 to Many: Does this make sense ? I think this design is a better approach but only if it's based on human

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

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
exist in the many to many / one to many design makes no sense to me. I guess it serves as some type of support structure ? I agree that it would be better to have a list prepared for users to choose from. I'm working on a job board. Looking out on the vast sea of careers and positions it's pretty

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 Rhino
Shawn, Yes, we *are* on the same page, now that I understand that you didn't mean to implement the many-to-many relationship in a single table. Stuart, Read what Stuart has described in this note. The association table is the one he calls TItle_Member. This table is *crucial* to the design

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
the lack it would still leave. I'm going to go over my schema though and see where the many to many relationships will work well for me. I'm assuming telephone numbers (SL Green's example) that are specific to the user / member need not necessarily be broken out ? Perhaps they should be. Stuart

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] Sent: Friday, August 27, 2004 3:05 PM Subject: Re: Many to Many: Does

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Stuart Felenstein
[EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; Stuart Felenstein [EMAIL PROTECTED] Sent: Friday, August 27, 2004 3:05 PM Subject: Re: Many to Many: Does this make sense ? Now I am totally clear on it! Took a few reiterations but I'm there. Even more I'm going to abandon

Re: Many to Many: Does this make sense ?

2004-08-27 Thread Rhino
] 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 sense ? Let me answer the first part now and then continue reading. You absolutely gave me some great ideas

Re: How do I select 'all related' in a many-to-many relation?

2003-02-25 Thread Mac
Harald Fuchs wrote: That's easy: [Excellent MySQL code example snipped] Thanks, that was exactly what I was looking for. /mac - Before posting, please check: http://www.mysql.com/manual.php (the manual)

How do I select 'all related' in a many-to-many relation?

2003-02-20 Thread Mac
Hi, I am using MySQL v3.23 and have a many-to-many relationship (cars - colors) that I have broken up into three tables as follows cars: ID Manufacturer 1 Volvo 2 BMW 3 Toyota colors: ID

Re: updating many-to-many relationships?

2003-02-20 Thread gerald_clark
I don't have a mailing list, and I don't appreciate your email. You subscribed to the mysql mailing list, or you would not be getting it. The instructions to unsubscribe are at the bottom of every message. Kip McGee wrote: will you please take me off of your mailing list if you dont im gonna

Re: How do I select 'all related' in a many-to-many relation?

2003-02-20 Thread Diana Soares
Hi, On Thu, 2003-02-20 at 13:20, Mac wrote: Hi, I am using MySQL v3.23 and have a many-to-many relationship (cars - colors) that I have broken up into three tables as follows cars: ID Manufacturer 1 Volvo 2 BMW 3 Toyota

Re: How do I select 'all related' in a many-to-many relation?

2003-02-20 Thread Mac
Blue Hmm, does this only return one row for each Manufacturer? I'll have to check it out. Well at least I know I can't use the same trick here as I did in my first query, since I don't know how many colors I could get returned. /mac -- Protect

updating many-to-many relationships?

2003-02-19 Thread Paul Chvostek
Hi all. I need some help figuring out how to update a many-to-many relationship from a text file. For the fun of it, let's call the tables 'sku' and 'agent'. Each sku can have multiple agents (usually 10, always 0), and each agent can be associated with an unlimited number of records skus

Re: updating many-to-many relationships?

2003-02-19 Thread gerald_clark
Looks to my like skuagent should be using the varchar fields instead of the int fields. Then you could just insert ignore each line from your test file. Paul Chvostek wrote: Hi all. I need some help figuring out how to update a many-to-many relationship from a text file. For the fun

Re: updating many-to-many relationships?

2003-02-19 Thread Paul Chvostek
wrote: Looks to my like skuagent should be using the varchar fields instead of the int fields. Then you could just insert ignore each line from your test file. Paul Chvostek wrote: Hi all. I need some help figuring out how to update a many-to-many relationship from a text file

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

2002-04-18 Thread =d0Mi=
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 to MANY] relationship with MySQL ??? Hi Robbie Reading what I wrote wasn't very clear to me either

[MANY to MANY] relationship with MySQL ???

2002-04-17 Thread Robbie Newton
: Go to the samples page and choose an album to sample. Returns the list of song names that result from the album you chose click on one of the song names to open a new window with the shockwave file that streams the song. The client has asked me to add the (one or many) artists featured in that song

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] relationship with MySQL ???

2002-04-17 Thread Arthur Fuller
compose. hth, Arthur - Original Message - From: Robbie Newton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 17, 2002 10:25 PM Subject: [MANY to MANY] relationship with MySQL ??? Hello all, [~~I guess I could do something like MySQLselect FROM Songs where artists

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 Matthew Smith
am not quite sure what you mean... but here is my take anyways. Is this going around my elbow? Or is this just how you do relationals in SQL? This is a standard way of doing many-to-many relationships in SQL; there may be others. (For each relationship you may want to have in a system

querying for non-matching records in many-to-many relationship

2002-02-01 Thread Myk Melez
I can't figure out how to formulate a query to retrieve a certain set of data. I have two tables in a many-to-many relationship with each other via a linking table. I want to get a list of the records in the first table which have no matching records of a certain value in the second table

is it a many-to-many?

2001-11-14 Thread Carlo Loiudice
both (or any...this is only an example) the joins ID_weight_measure with the related symbol, and the ID_height_measure with its symbol? I don't know if it's a many-to-many relationship, and even if it is, I don't know how to implement it. I hope in your help. Ciao carlo

Re: is it a many-to-many?

2001-11-14 Thread Aleksandar Bradaric
ID_weight_measure with the related symbol, and the ID_height_measure with its symbol? I don't know if it's a many-to-many relationship, and even if it is, I don't know how to implement it. I hope in your help. select p.id_weight_measure, m1.symbol, p.id_height_measure, m2.symbol from product p

RE: Can one SELECT records depending on multiple entries in a many to many table?

2001-10-02 Thread Joe Kaiping
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Benjamin Hi. On Mon, Oct 01, 2001 at 07:54:37PM -0700, [EMAIL PROTECTED] wrote: Hi there, I have a many-to-many relationship: ind table - id = 4, name = Joe id = 5, name

Can one SELECT records depending on multiple entries in a many to many table?

2001-10-01 Thread Joe Kaiping
Hi there, I have a many-to-many relationship: ind table - id = 4, name = Joe id = 5, name = Jane bus_ctr table - id = 1, name = downtown mall id = 2, name = sunshine mall id = 3, name = express shop mm_ind_bus_ctr table (many to many association table

Re: Can one SELECT records depending on multiple entries in a many to many table?

2001-10-01 Thread Benjamin Pflugmann
Hi. On Mon, Oct 01, 2001 at 07:54:37PM -0700, [EMAIL PROTECTED] wrote: Hi there, I have a many-to-many relationship: ind table - id = 4, name = Joe id = 5, name = Jane bus_ctr table - id = 1, name = downtown mall id = 2, name = sunshine mall id = 3, name

many to many join on 2 tables.

2001-07-16 Thread Nick Davies
Hi, I'm have a bit of difficulty with a many to many join on two tables. (Where an item is directly related to another item of the same type in the same table). I'm trying to use the same method as a join between 2 tables with a 3rd but having no joy. Help :) eg

Re: many to many join on 2 tables.

2001-07-16 Thread Cal Evans
as t2 where t1.blah = t11.blah and t1.blah = t2.blah; Or something to that effect. Cal * * Cal Evans * Senior Internet Dreamer * http://www.calevans.com * - Original Message - From: Nick Davies [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 16, 2001 08:02 Subject: many to many

Help: Many to Many Select

2001-07-13 Thread Simon
Hello, I need help with a select statement on my database. (I am still on L Plates with Mysql) My Tables Clients - Holds clients infomation Targets - Holds Target infomation Clients_Targets - Holds Clients Id and Targets Id How do I find clients that are in

Re: Help - Selecting from many to many table.

2001-07-08 Thread Rolf Hopkins
Subject: Help - Selecting from many to many table. Hello, I am new to SQL and just learning. I have a table of clients and a table of targets. I have a clients_targets table holding the keys for relating. I am having troble trying to select clients that are in more than one target. Eg

Help - Selecting from many to many table.

2001-07-07 Thread Simon
Hello, I am new to SQL and just learning. I have a table of clients and a table of targets. I have a clients_targets table holding the keys for relating. I am having troble trying to select clients that are in more than one target. Eg. Select c.First_Name, ... From clients as c,

Many to Many

2001-04-19 Thread Agustin Eloy Barrios Arteaga
Hello again here send al SQL to generate the database to test in MYSQL, for example in case that I Question in the query that a Productor TECUN (1) no cant be return, pepe(2), lolo(1) CEIS (2) no cant be return lolo(1) PCMAX (3) no cant be return pepe(2) A Numbres are the ID In the table cp

Re: AND on a many to many table, with arbitrary ANDs

2001-01-31 Thread Rus
PROTECTED] Sent: Wednesday, January 31, 2001 7:50 AM Subject: AND on a many to many table, with arbitrary ANDs Hello everyone, I am in the process of building a search engine on a database. I have two tables that have a many-to-many relationship: A story table and a category table. S

RE: AND on a many to many table, with arbitrary ANDs

2001-01-31 Thread Javier Muniz
:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 2:11 AM To: [EMAIL PROTECTED] Subject: Re: AND on a many to many table, with arbitrary ANDs I think you could use 'WHERE catid IN' For example, on PHP $catlist="1,2,3,4,5"; ... select ... where ... catid in ($catlist) And of course you

AND on a many to many table, with arbitrary ANDs

2001-01-30 Thread Beasley, Julien
Hello everyone, I am in the process of building a search engine on a database. I have two tables that have a many-to-many relationship: A story table and a category table. Story Table: --- id | story| --- 1 | Alice in Wonderland 2 | Peter Pan 3 | Pokemon's adventure 4 | Tale

  1   2   >