SELECT * from
(SELECT
ROW_NUMBER() OVER (ORDER BY mau.id) AS NO,
mau.id AS id,
map.name AS mobilename,
mau.no AS nos,
mau.password AS password,
mau.devices AS devices,
mau.firstlogin AS firstlogin,
mau.uselog AS uselog,
mau.description AS descs,
mau.appid AS appid
FROM
mc_magiccard_code mau
LEFT JOIN mc_magiccard map ON map.id = mau.appid
)t
$condition WHERE t.appid=@keyid ORDER BY t.NO DESC