title: How do I create a comma-separated list using a SQL query?
body: <p>I have 3 tables called:</p>
  
  <ul>
  <li>Applications (id, name)</li>
  <li>Resources  (id, name)</li>
  <li>ApplicationsResources (id, app_id, resource_id)</li>
  </ul>
  
  <p>I want to show on a GUI a table of all resource names. In one cell in each row I would like to list out all of the applications (comma separated) of that resource.</p>
  
  <p>So the question is, what is the best way to do this in SQL as I need to get all resources and I also need to get all applications for each resource?</p>
  
  <p>Do I run a select * from resources first and then loop through each resource and do a separate query per resource to get the list of applications for that resource?</p>
  
  <p>Is there a way I can do this in one query?</p>