別のCALLで使用する出力を取得しようとしています。私が欲しい出力は
Row | Col | Data | Seq
<70% | Voters | 5519 | 8
<80% | Voters | 4352 | 8
<90% | Voters | 3251 | 8
100% | Voters | 2511 | 8
私が持っているコードは
SELECT CASE
WHEN (poll_propensity >= 0.70 AND perm_absentee = 'N' AND mail_propensity = 0) THEN '< 70%'
WHEN (poll_propensity >= 0.80 AND perm_absentee = 'N' AND mail_propensity = 0) THEN '< 80%'
WHEN (poll_propensity >= 0.90 AND perm_absentee = 'N' AND mail_propensity = 0) THEN '< 90%'
WHEN (poll_propensity >= 1 AND perm_absentee = 'N' AND mail_propensity = 0) THEN '100%'
END AS Row,
'Voters' AS Col,
COUNT(voter_id) AS Data,
8 AS Seq
FROM ( SELECT p.voter_id, p.perm_absentee, vp.poll_propensity, vp.mail_propensity
FROM VoterProfile p
INNER JOIN DistrictPrecinct d ON d.precinct_id=p.precinct_code
INNER JOIN VoterPropensity vp ON p.voter_id=vp.voter_id
WHERE d.district_id= 3 AND vp.election_type= 'T' ) as derived
GROUP BY Row
しかし、出力を取得するすべてのimは次のようになります
Row | Col | Data | Seq
<70% | Voters | 5519 | 8
誰かがそれを助けることができれば、1つだけが通り抜けますそれは素晴らしいことです