I have 2 tables, Order and Store. And here are some of the fields from the table I need.
Order table
OrderId StoreId SystemOrderStatus
1 1 Received
2 1 Sent
3 2 Complete
4 2 Received
How can I achieve to have this output:
StoreId ReceivedStatusCount SentStatusCount CompleteStatusCount
1 1 1 0
2 1 0 1
Thank you.