OK, for the purposes of ym test environment, the figures are:
child 385 and 473
Now; if there is just one level to show because I use 56 in the where clause, the query shows it as level_1, which is fine.
However, if there is more than 1 level, say when I enter 170 or 385 in the where clause, each derivative of resultset is like this:
I need it to be
56, 170, 385
But, if I simply swap around the first three lines of the query, to get that sort of order, it puts a single entity result (56) as a third value with the two before it, being null
level_1.id as id_1
, level_2.id as id_2
, level_3.id as id_3
FROM businesses AS level_1
JOIN businesses as level_2
on level_2.id = level_1.parent_id
JOIN stylesheets as L2_s
on L2_s.business_id = level_2.id
AND L2_s.live_or_dev = 'live'
JOIN businesses as level_3
on level_3.id = level_2.parent_id
JOIN stylesheets as L3_s
on L3_s.business_id = level_3.id
AND L3_s.live_or_dev = 'live'
JOIN stylesheets as L1_s
on L1_s.business_id = level_1.id
AND L1_s.live_or_dev = 'live'
WHERE level_1.id = 385
pondering over some sleeeeep.