S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level
from S left join S as yS on S.ID1 between yS.ID1 and yS.ID2
group by xID;
# w/o alias in "order by"
select S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level
from S left join
S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level
from S left join S as yS on S.ID1 between yS.ID1 and yS.ID2
group by xID;
# w/o alias in "order by"
select S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level
from S left join
>Description:
3 "select" with little difference (2 with strange result, and last correct)
==
select
Schedule.PTRScheme as Scheme_ID,
Subject.TID as Subject_TID,
Scheme.PTRSubject as Subject_ID,
if(count(distinct Le