想要这样的语句
SELECT "accountuuid" AS "accountuuid" , "authid" AS "postid" ,
COUNT(( CASE WHEN ( "abnormaltype" =2 ) THEN 1 ELSE NULL END )) AS "listingabnormalcount" ,
FROM "t_test" GROUP BY "accountuuid","authid"
生成的是
SELECT "accountuuid" AS "accountuuid" , "authid" AS "postid" ,
COUNT(( CASE WHEN ( "abnormaltype" = @Abnormaltype0 ) THEN "asin" ELSE @MethodConst1 END )) AS "listingabnormalcount" FROM "t_summaryabnormal" GROUP BY "accountuuid","authid"
@Abnormaltype0:2,@MethodConst1:
想要这样的语句 SELECT "accountuuid" AS "accountuuid" , "authid" AS "postid" , COUNT(( CASE WHEN ( "abnormaltype" =2 ) THEN 1 ELSE NULL END )) AS "listingabnormalcount" , FROM "t_test" GROUP BY "accountuuid","authid"
生成的是
SELECT "accountuuid" AS "accountuuid" , "authid" AS "postid" , COUNT(( CASE WHEN ( "abnormaltype" = @Abnormaltype0 ) THEN "asin" ELSE @MethodConst1 END )) AS "listingabnormalcount" FROM "t_summaryabnormal" GROUP BY "accountuuid","authid" @Abnormaltype0:2,@MethodConst1:
@MethodConst1传不了null