sql - combining count(column) with count(column) in same table (MSSQL) -


i missing obvious here, if wanted combine this

select location, count(location) item group location 

with this

select collection, count(collection) item group collection 

in same result set. want see how many items in each collection @ each location.

edit: i'd see location column , collection row

edit: looks i'll need pivot make happen

is simple this?:

select location,collection, count(*) item group location,collection 

that's sprang mind from

how many items in each collection @ each location.

but if it's wrong, maybe should add sample data , expected results question.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -