修改后执行只有一个值,,,1200,还缺个全部的数量,可以放到一起吗?
追答SELECT SUM(payment_alreadyprice) as currentYearNum,(SELECT SUM(payment_alreadyprice) FROM property_payment) as allYearNum FROM property_payment WHERE year(payment_time) = year(curdate())
或者
SELECT SUM(payment_alreadyprice) FROM property_payment WHERE year(payment_time) = year(curdate())
union all
SELECT SUM(payment_alreadyprice) FROM property_payment
第二条语句需要用一个list来接收