这个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 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 8 行的“order by id desc”附近使用正确的语法
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