看下面这两句代码,不要以为结果都一样
SELECT COUNT(*) AS icount FROM bc_User_Gold WHERE FROM_UNIXTIME(gTime,’%Y-%m’) <= '2009-03'
SELECT COUNT(*) AS icount FROM bc_User_Gold WHERE FROM_UNIXTIME(gTime,'%Y-%m') <= '2009-3'
第一条能正确返回结果,第二条会查询出3月后的所有日期。
比格高
逼格更高