Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **BranchId GroupCode Cash Credit**
- 1000 AA 10 8644
- 1000 AA 12 1244
- 1000 BB 20 7535
- 1000 CC 30 5633
- 1001 AA 50 5763
- 1001 AA 34 2343
- 1001 BB 60 1000
- 1001 BB 62 2346
- 1002 BB 34 1600
- 1002 CC 68 1700
- **BranchId | AA_Cash | AA_Credit | BB_Cash | BB_Credit | CC_Cash | CC_Credit**
- 1000 ?
- 1001
- 1002
- select * from
- (select bid, GroupCode, Cash FROM dueList) as T
- PIVOT (sum(Cash) for GroupCode in([AA_Cash],[BB_Cash],[CC_Cash])) PT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement