|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi all, thanks for taking the time...
Here's a sample query: SELECT a.*, p.* FROM author_information a LEFT JOIN products p on (a.authors_id IN ( p.author_information_id ) ) p.author_information_id is a field comprised of multiple authors -- ie "2,34,41". I've also tried: SELECT a.*, p.* FROM author_information a LEFT JOIN products p on all (a.authors_id IN ( SELECT products.author_information_id from products where products.products_id = p.products_id)) Both are valid, but only return one author, not authors 2,34 & 41. Incidentally, I've also tried joining author_information to products, just a shot in the dark that didn't go anywhere either. Hard coding the values LEFT JOIN.....on ( a.authors_id IN ( 2,34,41 )) returns exactly what I'm looking for. Can anyone point me in the right direction? Thanks, |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
kevin wrote:
> Hi all, thanks for taking the time... > > Here's a sample query: > > SELECT a.*, p.* FROM author_information a > LEFT JOIN products p on (a.authors_id IN ( p.author_information_id ) ) > > > p.author_information_id is a field comprised of multiple authors -- ie > "2,34,41". > > I've also tried: > SELECT a.*, p.* FROM author_information a > LEFT JOIN products p on all (a.authors_id IN ( SELECT > products.author_information_id from products where > products.products_id = p.products_id)) > > Both are valid, but only return one author, not authors 2,34 & 41. > Incidentally, I've also tried joining author_information to products, > just a shot in the dark that didn't go anywhere either. > > Hard coding the values LEFT JOIN.....on ( a.authors_id IN ( 2,34,41 )) > returns exactly what I'm looking for. > > Can anyone point me in the right direction? Thanks, http://del.icio.us/Captain_Paralytic/normalization |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Dec 19, 2:48 pm, "Paul Lautman" <paul.laut...@btinternet.com>
wrote: > kevin wrote: > > Hi all, thanks for taking the time... > > > Here's a sample query: > > > SELECT a.*, p.* FROM author_information a > > LEFT JOIN products p on (a.authors_id IN ( p.author_information_id ) ) > > > p.author_information_id is a field comprised of multiple authors -- ie > > "2,34,41". > > > I've also tried: > > SELECT a.*, p.* FROM author_information a > > LEFT JOIN products p on all (a.authors_id IN ( SELECT > > products.author_information_id from products where > > products.products_id = p.products_id)) > > > Both are valid, but only return one author, not authors 2,34 & 41. > > Incidentally, I've also tried joining author_information to products, > > just a shot in the dark that didn't go anywhere either. > > > Hard coding the values LEFT JOIN.....on ( a.authors_id IN ( 2,34,41 )) > > returns exactly what I'm looking for. > > > Can anyone point me in the right direction? Thanks, > > http://del.icio.us/Captain_Paralytic/normalization Hahaha, ok, I know this is bad design, but I'm not being paid for making his data better, I'm just doing a quickie module... And is this even possible? |
|
![]() |
| Outils de la discussion | |
|
|