I have three tables as outlined below.
tblNews
NewsId | Title |
======================
1 | Hello World |
tblSectionItems
rID | SectionID | NewsID |
=================================
1 | 1 | 1 |
2 | 2 | 1 |
tblSections
SectionId | SectionName |
===================================
1 | Economy |
2 | Politics |
How would I go about and have a single query to output like the following? Or even better How can I do this with Linq - EF?
| NewsID | Title | SectionNames
=====================================
| 1 | Hello World | Economy, Politics |
What I have tried up until now are with using JOINS which in turn outputs something like
| NewsID | Title | SectionNames
=====================================
| 1 | Hello World | Economy |
| 1 | Hello World | Politics |
which is not a desired output.
Any help or direction to an article or a tutorial will be appreciated. Thanks..