I’m learning SQL, so far everything is fairly easy to understand but I have one thing thats troubling and I didn’t found any answer neither here, ad on google.
Im doing project called: How to Hack Hacker News
There is a code line:
SELECT strftime(’%H’, timestamp),
GROUP BY 1
ORDER BY 1;
MY question is, how SQL knows what it should count with ( * )? Why it doesn’t count the ‘avg score’, or ‘hours’ for example? If I don’t want to use ( * ) what should i write inside to make it work as well ( ) ?
It’s not only in this example, usage of ( * ) puzzled me few times so far. I understand what this command does, I just don’t understand how ( * ) is choosing what column to consider at given query.
Thanks for help.