搞好久 sr_body 一直group不起來, 結果原來是因為它是text的欄位 =.=|||
所以要用 substring() Function 來取, 最大值到 4000 個字元
SELECT sr_sd_id, sr_dlvtime, SUM(sr_pointUsed) AS sr_pointUsed, substring(sr_body, 1, 4000) as sr_body FROM smsReceiver
WHERE sr_sd_id in ( select sd_id from smsDir where sd_Status='0')
group by sr_sd_id, sr_dlvtime, substring(sr_body, 1, 4000)
沒有留言:
張貼留言