Prev: marvendas@gmail.com Kit completo de Solenoides ( solenoid ) + chicotePara Cambio automatico 01M hidramatico Audi A3 Vw Golf gti turbo 36832
Next: output to html
From: --CELKO-- on 20 Feb 2010 15:39 >> I didn't specify the order because I might wish different orders: model's year ascending or descending, for example, or name.<< SELECT X.* FROM (SELECT auto_make, auto_model, ROW_NUMBER() OVER (PARTITION BY auto_make ORDER BY model_year DESC) AS model_year__ordering FROM Motorpool) AS X WHERE X.model_year_ordering <= @n; >> Thanks, it works exactly the way I need. I didn't know "OVER PARTITION BY". << It is called a window clause and it can be very handy. Look it up.
From: --CELKO-- on 20 Feb 2010 15:43
Because he said "car brand", which the industry calls "make"; there are other terms for various characteristics of a model, such as "glasshouse", etc that would be used. Hey, be glad I did not ask about the VIN :) |