mysql - How to count new users in last month in SQL? -
i want know how many new users have last month, , how many of them have turned buyers while can not figure out smoothly.the following coded.
select count(distinct(product_id)) order_table o inner join customer_table c on o.customer_id=c.customer_id datediff(month,order_date,getdate())<=1
and there question has confused me lot: category have highest year year growth in terms of revenue in 2016?
this should it...
select count(customer_id) customer_table customer_id in ( select customer_id order_table ) , datediff(month, first_visit, getdate()) <= 1
Comments
Post a Comment