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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -