Santiago Moresi

Generation

text to sql syntaxFri, 14 Jul 2023

Del total de clientes que realizaron compras en 2020. Que porcentaje lo hizo en una sola sucursal. Teniendo tabla, compra, sucursal, cliente

SELECT COUNT(DISTINCT(cliente)) * 100 / (SELECT COUNT(DISTINCT(cliente)) FROM compra) as porcentaje FROM compra WHERE YEAR(fecha) = 2020 GROUP BY sucursal;

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