Last answered:

09 Sept 2022

Posted on:

09 Sept 2022

0

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)
Instructor
Posted on:

09 Sept 2022

2

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.
Best,
Tsvetelin

Submit an answer