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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -