0
ID mobileno dateofregistration registrationstate
44 1674174925 2011-04-18 10:17:30.670 0
45 1677864168 2011-03-31 10:20:22.450 1
46 1677864161 2011-04-18 20:47:35.293 0
47 1674174925 2011-03-29 09:28:55.200 1
48 1674174967 2011-03-29 09:28:55.100 1
SELECT CONVERT(varchar(10), dateofregistration, 103) AS Date , COUNT(1) AS Subbase , SUM(CASE WHEN registrationstate='1' THEN 1 ELSE 0 END) AS NewAct , SUM(CASE WHEN (registrationstate='0' and registrationstate='1') THEN 1 ELSE 0 END) AS SuccessRen FROM tbl_User GROUP BY CONVERT(varchar(10), dateofregistration, 103) ORDER BY 1
どのようにして、登録状態が0から1に変更されたことを伝えることができますか? –
@ Will A:おそらく前の(日付による)値に基づいています。 –