Answers for "productros mas vendidos por rango de cantidad sql"

SQL
0

productros mas vendidos por rango de cantidad sql

DECLARE @FechaInicio date = '20151026';
DECLARE @FechaFin date = '20151031';

SELECT
        TOP (10) WITH TIES
        arti.cod_articulo,
        SUM(vear.cantidad_venta) [Total Venta]
FROM
        venta vent
        INNER JOIN venta_articulo vear ON (vear.cod_factura = vent.cod_factura)
        INNER JOIN articulo arti ON (arti.cod_articulo = vear.cod_articulo)
WHERE
        fecha_venta BETWEEN @FechaInicio AND @FechaFin
GROUP BY
        arti.cod_articulo
ORDER BY
        [Total Venta] DESC;
Posted by: Guest on June-24-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language