I have a table
select * from table
values returning are
login id | status_name | count
===============================
admin | open | 3
admin | closed | 5
test | inprogress | 10
test | open | 10
test | closed | 11
user1 | closed | 5
user1 | pending | 10
how can i transfer this data from row to column?
I want in this manner
login_id | open | closed | inprogress | pending
================================================
admin | 3 | 5 | 0 | 0
test | 10 | 10 | 10 | 0
user1 | 0 | 5 | 0 | 10
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…