userid ) b ON a.ID = b.appid where a.APPENABLED=1 and ((a.OWNTYPE=0 <@p p=" and %s" f="a.createuser=?">createuser) or (a.OWNTYPE=1 and b.userid is not null)) ORDER BY a.ORDERVALUE ASC ]]> userid ) b ON a.ID = b.appid LEFT JOIN ( SELECT COUNT(userid) AS installCount, appid FROM jcdp_chat_apps_my GROUP BY APPID ) c ON c.appid = a.id where a.APPENABLED=1 and a.ownType=1 ORDER BY a.ORDERVALUE ASC ]]> userid,appid) VALUES(<@p f="?">userid,appid) ]]> userid <@p p=" and %s" f="appid=?">appid ]]>