by nodesocket · 9y ago · 0 comments
Take the following example:
SELECT s.`id`,
s.label,
s.`group`,
g.name AS group_name,
s.tags,
s.ssh_username,
s.ssh_port
FROM servers s
LEFT OUTER JOIN groups g
ON s.group = g.`id`
ORDER BY s.label ASC
In an unrelated note, how does everybody else format their SQL? The above format is what I typically use.