The following SQL statements in oralce can run, not a to mysql, mainly in the group after the count, and then sum the count the number of given here in mysql, bosses mysql write
SELECT the UN DIGCONTENT, UN DIGRESULT,
COUNT (DISTINCT UN. DIGVINNO) CARCOUNT,
COUNT (*) DXCOUNT,
100 * ROUND (COUNT (*)/SUM (COUNT (*)) OVER (), 4) | | '%' PROPORTION
The FROM (
The SELECT T.D IGVINNO, R.D IGCONTENT, R.D IGRESULT, T.O PERATETIME FROM ODX_DIGRESULTLOG R
LEFT the JOIN ODX_DIGOPERLOG T ON T.D IGTOKEN=R.D IGTOKEN
WHERE R.D IGTYPE=3 AND R.F LAG=1 AND R.D IGRESULT IS NOT NULL AND R.D IGCONTENT IS NOT NULL
UNION ALL
SELECT the OV DIGVINNO, OP. DIGCONTENT, OP. DIGRESULT, OV. CREATEDON OPERATETIME FROM ODX_OFFCMD_PARSESULT OP
RIGHT JOIN ODX_OFFCMD_VISIBLERESULT OV ON OP. RESULTID=OV. ID
WHERE the OV. FLAG=1 AND OV. DIGTYPE=3 AND OP. STATE=1
) the UN the WHERE (=1)
GROUP BY DIGCONTENT, DIGRESULT
The order by dxcount desc