Reputation: 223
I have data in table in following format.
CustomerID | CustomerName | DisplayOrder | isActive
1 | Test | 1 | 1
1 | Test | 2 | 1
2 | Test2 | 1 | 1
1 | Test | 3 | 1
2 | Test2 | 2 | 1
Above table need to be sorted based on displayorder column per customer. Each customer will have thier own display order. Here I cannot use OrderBy Clause direcly because Display order will repear per customer.
Expected Output is:
CustomerID | CustomerName | DisplayOrder | isActive
1 | Test | 1 | 1
1 | Test | 2 | 1
1 | Test | 3 | 1
2 | Test2 | 1 | 1
2 | Test2 | 2 | 1
Please help on order by clause to sort based on customer.
Upvotes: 1
Views: 44