Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. antionio

    3 best buyers per year

    (:I r937, it works perfectly!! I followed your suggestions and first made a table 'client_year_totals' and cut part of your code like this: select cliente , total , año from TOTALES as CTE where 3 > ( select count(*) from TOTALES where año = CTE.año...
  2. antionio

    3 best buyers per year

    Thanks PHV, my last attempt was.... SELECT A.cliente, A.total, A.año FROM PEDIDOS INNER JOIN ( SELECT cliente, sum(parcial) as total, year(fecha) as año FROM PEDIDOS GROUP BY año ORDER BY año, total LIMIT 3) AS A what gives lots of...
  3. antionio

    3 best buyers per year

    Hello, can anybody help me with this? I have a 2500 records in one table where i have registered the last 5 years sales. How can I >>sum all the sales of a customer in a given year >>get the top 3 buyers in a given year >>for the whole period (5 years) >>in only one sql stament, if possible...
  4. antionio

    3 top buyers per year

    Hello, can anybody help me with this? I have a 2500 records in one table where i have registered the last 5 years sales. How can I >>sum all the sales of a customer in a given year >>get the top 3 buyers in a given year >>for the whole period (5 years) >>in only one sql stament, if possible...

Part and Inventory Search

Back
Top