Monday, June 30, 2014

Formatting SQL table data by creating a new column

The answer is that with the given source data, it is not possible produce the source. The reason for this is that a table is an unordered object, so there is no such thing as a "first row".


If there is a hidden column which defines the order in the source, it is logically possible, although still a little tricky. I suspect though that what you call source columns are not the actual source, but they are in their turn derived from another source, and maybe we should go back one step to make the problem simpler.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

No comments:

Post a Comment