Prendi il database NWind.mdb e prova questa query:
SELECT
Count(uu) AS num, a.CustomerID, a.CompanyName, a.ContactName
FROM
Customers a, (SELECT b.CustomerID, b.CompanyName, 1 AS uu FROM Customers b) b
WHERE a.CustomerID + a.CompanyName > b.CustomerID + b.CompanyName
GROUP BY a.CustomerID, a.CompanyName, a.ContactName
ORDER BY Count(uu)
Il risultato sarà questo:
num CustomerID CompanyName ContactName
1 ANATR Ana Trujillo Emparedados y helados Ana Trujillo
2 ANTON Antonio Moreno Taquería Antonio Moreno
3 AROUT Around the Horn Thomas Hardy
4 BERGS Berglunds snabbköp Christina Berglund
5 BLAUS Blauer See Delikatessen Hanna Moos
6 BLONP Blondel père et fils Frédérique Citeaux
7 BOLID Bólido Comidas preparadas Martín Sommer
8 BONAP Bon app' Laurence Lebihan
9 BOTTM Bottom-Dollar Markets Elizabeth Lincoln
.........