Subject | Re: select help needed |
---|---|
Author | wbruhin |
Post date | 2010-01-27T15:53:46Z |
André, Sven and Helen,
Thanks for your fast responses.
André's solution works perfectly. Sven's worked fine to with the example given, but if I throw some more rows, where there is e.g. a "EN_en" with a corresponding "DE_de" but no FR_fr, then Sven's solution is showing both the "EN_en" and the "DE_de".
I.e.:
ID CODE_ID LANG_CODE5 NAME SHORT_NAME CREATED_AT UPDATED_AT
3 3 EN_en english name 3 en name 3 26/01/2010 26/01/2010 17:37:28
4 3 FR_fr french name 3 fr name 3 26/01/2010 26/01/2010 17:37:28
5 4 EN_en english name 4 en name 4 26/01/2010 26/01/2010 17:38:16
6 4 FR_fr french name 4 fr name 4 26/01/2010 26/01/2010 17:38:16
7 5 EN_en english name 5 en name 5 26/01/2010 26/01/2010 17:53:37
9 7 EN_en english name 7 en name 7 27/01/2010 27/01/2010 16:46:10
10 7 DE_de german name 7 de name 7 27/01/2010 27/01/2010 16:46:10
After adding an index on code_id as suggested by Sven both perform about the same on a small table.
Thanks again for your help
Werner
Thanks for your fast responses.
André's solution works perfectly. Sven's worked fine to with the example given, but if I throw some more rows, where there is e.g. a "EN_en" with a corresponding "DE_de" but no FR_fr, then Sven's solution is showing both the "EN_en" and the "DE_de".
I.e.:
ID CODE_ID LANG_CODE5 NAME SHORT_NAME CREATED_AT UPDATED_AT
3 3 EN_en english name 3 en name 3 26/01/2010 26/01/2010 17:37:28
4 3 FR_fr french name 3 fr name 3 26/01/2010 26/01/2010 17:37:28
5 4 EN_en english name 4 en name 4 26/01/2010 26/01/2010 17:38:16
6 4 FR_fr french name 4 fr name 4 26/01/2010 26/01/2010 17:38:16
7 5 EN_en english name 5 en name 5 26/01/2010 26/01/2010 17:53:37
9 7 EN_en english name 7 en name 7 27/01/2010 27/01/2010 16:46:10
10 7 DE_de german name 7 de name 7 27/01/2010 27/01/2010 16:46:10
After adding an index on code_id as suggested by Sven both perform about the same on a small table.
Thanks again for your help
Werner