I am using these two queries to fetch records whose salary is less than 1/10th of the 200000.
select first_name, last_name, salary from employee where salary < 200000 * 1/10select first_name, last_name, salary from employee where salary < 1/10 * 200000
The first query gives the required output(attached below in the image). But the second query doesn't gives any record in the output(no-error).
According to my understanding of precedence in SQL both query should work in same way. That division and multiplication operator should execute first than comparison operator.
Even, If I put parenthesis in the Second query, then also it's not giving any output.
select first_name, last_name, salary from employee where salary < ((1/10) * 200000)
So, why the Second query is not giving any output?