我想构建一个mysql_query
,只会在rows
中插入一个新的table
,其中where condition
就像...... {/ p>
SELECT (LAST 5) FROM `x` WHERE `USER_KEY` = '$RK' ORDER BY `dd` DESC
此数据将在json中解析,否则我将获得所有数据并循环投掷。
答案 0 :(得分:2)
你可以撤销订单并获得第一个5.这与获得最后5个并以相反方式排序相同
SELECT * FROM `x` WHERE `USER_KEY` = '$RK' ORDER BY `dd` ASC limit 5
或者如果你需要desc命令,你可以做
select * from (SELECT * FROM `x`
WHERE `USER_KEY` = '$RK'
ORDER BY `dd` asc
limit 5) as x
order by `dd` desc