select a.customerID ,count(a.customerID) from customers a, customers b where a.customerID >=b.customerID group by a.customerID
---------------------------------------------------------------
有什么问题?
如果要求列出customers的内容,加多一个名次项呢?
---------------------------------------------------------------
不太清楚你问题的意思,是不是把:
group by a.customerID
改成
order by a.customerID
---------------------------------------------------------------
select a.customerID ,count(a.customerID) Idd from customers a, customers b where a.customerID >=b.customerID group by a.customerID
order by Idd