select
sc.id as id,
sc.quantity as quantity,
sc.store_id as store_id,
st.code as code
from
storesubcards sc
LEFT JOIN stores ST ON ST.ID=sc.store_id
where
sc.storecard_ID=:StoreCard_ID and
sc.quantity<>0 and
sc.store_id in
(select
store_id
from
posshops3
where
parent_ID=:POSShop_ID)
order by st.codeGenerated by ABRA Software a.s. 27.10.2021 16:34:12