Santiago Moresi

Generation

text to sql syntaxFri, 14 Jul 2023

Necesito sacar el Mes con mayor crecimiento en el año 2020 con respeto al 2019. Tengo tabla venta, compra

select month(fecha) 'Mes', sum(total) 'Venta 2020', (select sum(total) from venta where year(fecha)=2019) 'Venta 2019', (sum(total)-(select sum(total) from venta where year(fecha)=2019)) 'Diferencia' from venta where year(fecha)=2020 group by month(fecha) order by 'Diferencia' desc;

Want to kickstart your project?Use the new AI Studio to create your code