Let’s have a query
SELECT `name`, `companyid`
FROM `users`
where the result could be
Peter | 1
Michael | 1
Tom | 2
John | 2
Ian | 4
Is it possible to create a query result where for each unique companyid value would be added a row
System | <current companyId>
so the result would be
Peter | 1
Michael | 1
System | 1
Tom | 2
John | 2
System | 2
Ian | 4
System | 4
1 Answer