Skip to content

Instantly share code, notes, and snippets.

@dadamssg
Created November 10, 2013 04:52
Show Gist options
  • Save dadamssg/7393979 to your computer and use it in GitHub Desktop.
Save dadamssg/7393979 to your computer and use it in GitHub Desktop.
MySQL companiesExtended view
CREATE VIEW companiesExtended AS
select *, (select group_concat(id separator ',') from people as peopleTable where companyTable.id = peopleTable.`company_id`) as people_ids from companies as companyTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment