Not sure how to describe this so I will show example:
table PAGES
id      int
parent  int
name    nvarchar
status  tinyint
table PAGES_MODULES
id          int 
id_parent   int
module_type nvarchar
module_id   int
status      int
One page can have more than one linked modules. Example records:
id    parent    name     status
1     -1        Xyz      1
2     -1        Yqw      1
id    id_parent    module_type    module_id     status
1     1            ARTICLE        1             1
2     1            GALLERY        2             1
3     2            CATEGORY       3             1
What I need is to create select which will not return 2 results if I do select left join page_modules.
I would like to have select which returns linked modules as this:
id    parent    name     status    modules
1     -1        Xyz      1         ARTICLE GALLERY
2     -1        Yqw      1         CATEGORY
Is that possible?
Thanks.
UPDATE
I have tried COALESE, CROSS APPLY and SELECT within SELECT methods and came to these conclusions:
http://blog.feronovak.com/2011/10/multiple-values-in-one-column-aka.html
Hope I can publish these here, not meaning to spam or something.
 
     
     
     
    