日期:2014-05-18 浏览次数:20508 次
CREATE PROCEDURE P_getnewnum @year INT , @month INT , @v VARCHAR(20) OUTPUT AS BEGIN SELECT @v = CASE WHEN SUM(CASE WHEN YEAR(registerdate) = @year AND MONTH(registerdate) = @month THEN 1 END) - SUM(CASE WHEN YEAR(registerdate) = @year - 1 AND MONTH(registerdate) = @month THEN 1 END) > 0 THEN 'good!' ELSE 'bad!' END FROM News END