MULTIPLE CRITERIA TABLE JOIN
Posted
by
user1447203
on Stack Overflow
See other posts from Stack Overflow
or by user1447203
Published on 2012-06-10T10:31:40Z
Indexed on
2012/06/10
10:40 UTC
Read the original article
Hit count: 151
mysql
I have a table listing clothing items (shirt, trousers, etc) named . Each item is identified with a unique CLOTHING.CLOTHING_ID. So a blue shirt is 01, a flowery shirt is 12 and jeans are 07 say.
I have a second table identifying outfits with a column for shirts, for trousers, shoes etc. For example Outfit 1: shirt 01, trousers 07 (i.e. blue shirt with jeans) Outfit 2: shirt 12, trousers 07 (so flowery shirt with jeans).
This table is named and each outfit is unique with OUTFIT_LIST.OUTFIT_ID.
I want to produce a select statement that will list each outfit's contents, i.e. find the clothing specified in Outfit 1.
Any help would be very much appreciated, and apologies in advance if I am missing a very simple solution. I have been playing with JOINS of all descriptions and CONCATS and so on with now luck - I am very new to this. Thanks.
© Stack Overflow or respective owner