时间:2021-07-01 10:21:17 帮助过:13人阅读
贴上xml--sql 语句
select FUSID,REALNAME,MOBILE,COMPANY,COMPANYWORK,COUNT from ( SELECT psf.FUSID,pam.REALNAME,pam.MOBILE,pam.COMPANY,pam.COMPANYWORK,count(psf.FUSID) as COUNT from PRE_SHAPP_FRIENDS psf JOIN PRE_AL_MEMBER pam ON pam.USID = psf.FUSID where psf.USID in (select FUSID from PRE_SHAPP_FRIENDS_STATUS where STATUS = 2 and USID = #{USID}) group BY FUSID UNION ALL select USID,REALNAME,MOBILE,COMPANY,COMPANYWORK,'' as COUNT from PRE_AL_MEMBER where USERNAME in (select USERNAME from PRE_AL_SHMEMBER where ISACTIVATION = 2) AND USID NOT IN (SELECT FUSID from PRE_SHAPP_FRIENDS where USID in (select FUSID from PRE_SHAPP_FRIENDS_STATUS where STATUS = 2 and USID = #{USID}))) as temp ORDER BY COUNT desc limit ${x},10
数据库结果是:
Java 后台结果:
求问题解决!!