Workaday Reading

COUNT(*) vs COUNT(id) in MySQL

“TL;DR: Use COUNT(), not COUNT(id), when you want to count rows. You have probably read in a bunch of different places that you shouldn’t use SELECT() in MySQL when you don’t need all the data. SELECT(*) selects all the columns in the table, not just the ones that you might need.”


read »

Leave a Reply

Your email address will not be published. Required fields are marked *