1DECLARE @FechaInicio date = '20151026';
2DECLARE @FechaFin date = '20151031';
3
4SELECT
5 TOP (10) WITH TIES
6 arti.cod_articulo,
7 SUM(vear.cantidad_venta) [Total Venta]
8FROM
9 venta vent
10 INNER JOIN venta_articulo vear ON (vear.cod_factura = vent.cod_factura)
11 INNER JOIN articulo arti ON (arti.cod_articulo = vear.cod_articulo)
12WHERE
13 fecha_venta BETWEEN @FechaInicio AND @FechaFin
14GROUP BY
15 arti.cod_articulo
16ORDER BY
17 [Total Venta] DESC;