Santiago Moresi

Generation

text to sql syntaxFri, 14 Jul 2023

Necesito saber de total de clientes que porcentaje compro solo por el canal 'online' entre los años '2019' y '2020'

SELECT ROUND(100 * (SELECT COUNT(*) FROM customers WHERE date >= '2019-01-01' and date <= '2020-01-01' and channel = 'online') / COUNT(*),2) as '% de pedidos por online' FROM customers;

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