SELECT count(id)FROM TBL_POS_SHOP s,TBL_POS_POS p,TBL_POS_CUSTOMER c,TBL_POS_ORDER o,TBL_POS_CARDINFO cdWHERE o.POS_CATI = p.POS_CATIand o.CUSTOMER_ID = c.IDand o.SHOP_ID = s.IDand o.CARDINFO_ID = cd.ID