このSQLクエリの何が問題になっていますか:
select a.*
from samples_order a
inner join
(
select distinct customeremail, min(id) as id
from samples_order group by customeremail
) as b
on a.customeremail = b.customeremail
and a.id = b.id where order_site="blindsuk"
and order_status = "logged" limit 50, 0
order by id desc
エラーが返されました: SQL 構文にエラーがあります。8 行目の「order by id desc」の近くで使用する正しい構文については、MySQL サーバーのバージョンに対応するマニュアルを確認してください。
select a.*
from samples_order a
inner join (
select distinct customeremail, min(id) as id
from samples_order
group by customeremail
) as b on a.customeremail = b.customeremail and a.id = b.id
where order_site="blindsuk"
and order_status = "logged"
limit 50, 0
order by id desc