http://blog.csdn.net/qiaqia609/article/details/41445233
SELECT urt.id, urt.user_id userId, urt.source_id sourceId, urt.trade_fee tradeFee, urt.total_balance totalBalance, urt.gmt_trade gmtTrade, urt.trade_type tradeType, urt.remarks, urt.flag, urt.audit_name auditName, urt.audit_reasons auditReasons, urt.gmt_audit gmtAudit, urt.pay_status payStatus, urt.payer, urt.gmt_pay gmtPay, pay_info payInfoFROM xy_user_reward_trade urt, ( SELECT TOP 6 row_number () OVER (ORDER BY id ASC) row_num, id FROM xy_user_reward_trade WHERE trade_type != 0 ) urt2WHERE urt.id = urt2.idAND urt2.row_num > 3ORDER BY urt2.row_num ASC
SELECT urt.id, urt.user_id userId, urt.source_id sourceId, urt.trade_fee tradeFee, urt.total_balance totalBalance, urt.gmt_trade gmtTrade, urt.trade_type tradeType, urt.remarks, urt.flag, urt.audit_name auditName, urt.audit_reasons auditReasons, urt.gmt_audit gmtAudit, urt.pay_status payStatus, urt.payer, urt.gmt_pay gmtPay, pay_info payInfoFROM xy_user_reward_trade urt, ( SELECT TOP 6 row_number () OVER (ORDER BY id ASC) row_num, id FROM xy_user_reward_trade ) urt2WHERE urt.id = urt2.id and trade_type != 0AND urt2.row_num > 3ORDER BY urt2.row_num ASC