spaceman12 Posted January 5, 2011 Share Posted January 5, 2011 Sombody please help me and tell me a way as how to count only non-empty cells in a column contained in a table of a database. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/223484-count-non-empty-cells-in-a-column/ Share on other sites More sharing options...
BlueSkyIS Posted January 5, 2011 Share Posted January 5, 2011 SELECT COUNT(*) FROM `some_table` WHERE some_column IS NOT NULL AND some_column != '' Quote Link to comment https://forums.phpfreaks.com/topic/223484-count-non-empty-cells-in-a-column/#findComment-1155235 Share on other sites More sharing options...
spaceman12 Posted January 5, 2011 Author Share Posted January 5, 2011 it still returns me the total number of rows and not only those that are not empty Quote Link to comment https://forums.phpfreaks.com/topic/223484-count-non-empty-cells-in-a-column/#findComment-1155237 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.