sql - Can i write this group by query without group by? -
i've written query find how many orders placed each customer? can write same querying without using group clause? using somekind of subquery , join.
select c.customerid, count(si.customerid) customer c left outer join salesinvoice si on si.customerid = c.customerid group c.customerid
select c.customerid, count(si.customerid) over(partition c.customerid) customer c left outer join salesinvoice si on si.customerid = c.customerid
Comments
Post a Comment