SELECT DISTINCT Kind,CNAME,( select to_number(Substr(kind,2,length(kind)-1)) from BatchCLIENT2KIND where kind <> 'all' and kind = k.kind) serno,(SELECT Remain_Person FROM RemoteTakeQuota WHERE DEP_CODE IS NULL AND OverDate=0 AND Kind=k.Kind) Weekdays, (SELECT Remain_Person FROM RemoteTakeQuota WHERE DEP_CODE IS NULL AND OverDate=1 AND Kind=k.Kind) WeekdSaturdayays, (SELECT Remain_Person FROM RemoteTakeQuota WHERE DEP_CODE IS NULL AND OverDate=2 AND Kind=k.Kind) Sunday FROM BatchCLIENT2KIND k ORDER BY serno