March 10, 2025 at 1:09 pm
Hi
How to get the below data we can create dynamically using Sql in a Table and then display using query. I will not be using Pivot .
I want to display data like below without Pivot. Locations can be more. How it can be done without using Pivot
Location 1Location 2Location 3Location 4
Item1Event110 20
Item2Event2 30 10 5
Thanks
March 10, 2025 at 1:11 pm
You have >1,000 points, so you must know by now how to provide sample data (in the form of CREATE TABLE and INSERT statements) and desired results based on that sample data.
March 10, 2025 at 6:52 pm
This was removed by the editor as SPAM
March 10, 2025 at 6:54 pm
This was removed by the editor as SPAM
March 12, 2025 at 7:01 pm
Hi
How to get the below data we can create dynamically using Sql in a Table and then display using query. I will not be using Pivot .
I want to display data like below without Pivot. Locations can be more. How it can be done without using Pivot
Location 1Location 2Location 3Location 4
Item1Event110 20
Item2Event2 30 10 5
Thanks
Like this if you have a fixed number of Locations...
https://www.sqlservercentral.com/articles/cross-tabs-and-pivots-part-1-converting-rows-to-columns-1
... and like this if they're not...
https://www.sqlservercentral.com/articles/cross-tabs-and-pivots-part-2-dynamic-cross-tabs
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply