I have 2 tables Asset Register
and LocationRoom
. I want to count the number of asset barcodes in each room.
I want the output to be the list of Asset Barcodes, Description,RoomNo and count for assets by room.
for example Room R0001 has 4 assets (01780,01781,01782,01783).
Best Answer
This does Query uses XML string concatenation to get the result in the format you need.
If
AssetID
orDescription
can be NULL then you would have to add additional logicResult
DB<>Fiddle
SQLFiddle
Edit:
Result
DB<>Fiddle