Last answered:

09 Sept 2022

Posted on:

09 Sept 2022


difference between two codes

Hi, why does the first code work too, but gives me a different outcome? thanks...image

1 answers ( 0 marked as helpful)
Posted on:

09 Sept 2022


Hi Kfir!
Thanks for reaching out.

Both codes work because they have correct syntax. The difference is because in the second one you have a filter -the WHERE clause. The first one does not have a filter. This condition in the COUNT() function is neglected by the Workbench. These codes are the same: COUNT(salary>=100000) and COUNT(salary).

Hope this helps.

Submit an answer