Select IdCliente, Count(IdPedido) As Pedidos From Tb_Pedidos Group By IdCliente Order By Count(IdPedido) Desc