数据库存的是每天的数据,现在我要的是没月最后一天的数据,不借助php,只用一句mysql搞定
SELECT (
sum( jc_ts_user ) + sum( by_ts_user )
) AS nums, cpname AS info_order, left( ts_date, 7 ) AS ts_Ym
FROM tsrate_tj
WHERE spname = '翔通移动'
AND TYPE = 'MMS'
AND ts_date
IN (
SELECT last_day( ts_date )
FROM tsrate_tj
)
LIMIT 0 , 30
这样写
MySQL 返回:#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select last_day( ts_date ) from tsrate_tj ) LIMIT 0, 30' at li
???怎么解决
mysql版本5.0以下