select a.id as serviceid,a.description,d.pcode,d.feetype,d.feecode,c.gateway,c.spcode from tbl_package as a, tbl_package_business as b , tbl_business_pcode as c, tbl_pcode as d where a.id=b.packageid and b.businessid=c.businessid and c.pcodeid=d.id and c.pcodetype=1