我正在尝试使用ORDER BY
对查询进行排序,但它声称存在语法错误。在尝试排序之前,我的查询如下所示:
SELECT u.*, s.*
FROM bands u
inner join statuses s on u.status_id = s.id
WHERE u.status_id = 1
LIMIT {$startpoint}, {$limit}
我试过ORDER BY
这样添加,但似乎不正确:
SELECT u.*, s.*
FROM bands u
inner join statuses s on u.status_id = s.id
WHERE u.status_id = 1
LIMIT {$startpoint}, {$limit} ORDER BY u.status_id
如何ORDER BY
在此查询中正确使用?