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 customer_id, count(DISTINCT sucursal_id) AS count FROM compra WHERE year(fecha) = 2020 GROUP BY customer_id HAVING count = 1;

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