摘要:
SELECT SUM(basicPrice) AS TotalBasicPrice,SUM(memberPrice) AS TotalMemberPrice,SUM(cfScore) AS TotalCfScore,COUNT(1) AS ProductCount,DATEPART(YEAR, inputTime) AS YearTime,DATEPART(month, inputTime) AS MonthTime FROM Pro_cf_Product GROUP BY DATEPART(YEAR, inputTime),DATEPART(MONTH, inputTime) 阅读全文
摘要:
--创建测试表CREATE TABLE Test( Test INT PRIMARY KEY)--创建存储过程ALTER PROC MyTest@Number1 INT,@Number2 INTASSET XACT_ABORT ON BEGIN TRAN BEGIN TRY INSERT INTO Test values(@Number1); INSERT INTO Test values(@Number2); END TRY BEGIN CATCH IF @@trancount > 0 ROLLBACK TRAN END CATCHIF ... 阅读全文