mysql - I want to display one columns data sum on different columns based on where clause -
mysql - I want to display one columns data sum on different columns based on where clause -
below image describe requirements have column having different info want count on status data=1 col1 , info = 2 col2 , on....
select count(case info when 1 1 else null end) col1, count(case info when 2 1 else null end) col2, count(case info when 3 1 else null end) col3, count(case info when 4 1 else null end) col4 yourtable
mysql sql
Comments
Post a Comment