sql 行数据找出最大的及所有数据最大的
SELECT @charges=ISNULL(MAX(a.maxcharge), 0.00) FROM( SELECT (SELECT MAX(maxcharge) FROM(VALUES(ilongcharge),(iwidthcharge),(iheightcharge),(iweightcharge ),(ivolumecharge)) AS maxcharge(maxcharge))AS maxcharge FROM @temp) a
SELECT @charges=ISNULL(MAX(a.maxcharge), 0.00) FROM( SELECT (SELECT MAX(maxcharge) FROM(VALUES(ilongcharge),(iwidthcharge),(iheightcharge),(iweightcharge ),(ivolumecharge)) AS maxcharge(maxcharge))AS maxcharge FROM @temp) a