Re: mysql query question (images,tags)

2006-11-09 Thread Jens Kleikamp
Jens Kleikamp schrieb: hi to all, I have a simple question/szenario. Here are my tables: 1. image (id, name) 2. tag (id, name) 3. images_tags (image_id, tag_id) At the moment I have the following working query, it selects all images which have *at least one of the tag ids* (25,30) assigned.

mysql query question (images,tags)

2006-11-09 Thread Jens Kleikamp
hi to all, I have a simple question/szenario. Here are my tables: 1. image (id, name) 2. tag (id, name) 3. images_tags (image_id, tag_id) At the moment I have the following working query, it selects all images which have *at least one of the tag ids* (25,30) assigned. SELECT DISTINCT image.

Re: MySQL query question

2005-12-24 Thread Peter Brawley
Josh, >I have several tables, all with many-to-many joining tables. > users > users_teams > teams > teams_projects > projects Once again explicit join syntax clarifies matters: SELECT DISTINCT username FROM users INNER JOIN users_teams ON (users.id = users_teams.user_id) INNER JOIN teams ON

Re: MySQL query question

2005-12-24 Thread Hank
>since I'm not sure how users would > ever be directly associated with teams - I would have expected to find > players to be associated with teams - so forgive me if this doesn't > resemble very much what you're doing: Think corporate projects, not sports. Here's my take on the original query.. y

Fw: MySQL query question

2005-12-24 Thread Rhino
Oops, I meant to copy the mailing list on this reply. Rhino - Original Message - From: "Rhino" <[EMAIL PROTECTED]> To: "Josh Mellicker" <[EMAIL PROTECTED]> Sent: Saturday, December 24, 2005 9:24 AM Subject: Re: MySQL query question - Ori

MySQL query question

2005-12-24 Thread Josh Mellicker
I have several tables, all with many-to-many joining tables. users users_teams teams teams_projects projects --- So, with a projects.id = 1, I want to get all the usernames of people on teams assigned to that project. SELECT DISTINCT username FROM users, users_teams, teams, projects_te

RE: MySQL query question

2003-11-07 Thread Andy Eastham
Chris, You're almost there! select * from temp where col2 like concat('%',col1, '%'); Andy > -Original Message- > From: Chris A. Mattingly [mailto:[EMAIL PROTECTED] > Sent: 07 November 2003 17:01 > To: [EMAIL PROTECTED] > Subject: MySQL query qu

MySQL query question

2003-11-07 Thread Chris A. Mattingly
I've searched around on the lists archives and even did some googling, but I'm having trouble finding the answer to this question. Given that I have a table with 2 columns (say col1, col2) I want to be able to search for the value of col1 in the value of col2. Let's say that in one instance co

[Fwd: mysql query question]

2002-05-17 Thread Sabine Richter
Sorry, I've been too long in a list where you just answer the questioner and then the questioner writes a summary of the answers to the list. Sabine Sabine Richter wrote: > > Hello Taylor, > > as far as I see from the documentation and own trials you can just > delete from table where conditio

mysql query question

2002-05-17 Thread Taylor Lewick
How can I delete from a table the results of a join query.. I.e, join two tables together, get the resutls, now want to delete that data from one of the tables... Do I have to create a tempory table, hold the data, and delete from the one table data matching in the temp table, or can I just co