Resolved: BETWEEN query SQL
Hello Martin!
In the BETWEEN exercise, the general rule states that the retrieved data would include the parameters in the BETWEEN statement. But when I try running the command I am unable to retrieve any value corresponding to the latter limit of the query. For example in the following query,
SELECT *FROM salaries WHERE salary BETWEEN 66000 AND 70000; (I tried the values by placing them in quotes too, did both)
- However, the values that I am getting are only greater than 66000 and lesser than 70000.
- If I use the syntax, SELECT *FROM salaries WHERE salary BETWEEN 66000 AND 70000 ORDER BY salary ASC; then I am getting values equal to 60000 and greater but still no value equal to 70000.
- If I use the syntax, SELECT *FROM salaries WHERE salary BETWEEN 66000 AND 70000 ORDER BY salary DESC; then I am getting values in the range of 70000 to 69000.
1 answers ( 0 marked as helpful)
Hi Archie!
Thanks for reaching out.
I did execute the queries from 2. and 3. and did obtain an output containing salary values of 70000.
Therefore, may I please ask you to check if you've set a limit to your output in Workbench? Please make sure there's no such a limit, and then you can retry running your queries.
Should the issue persist, please feel free to support your question with another screenshot.
Hope this helps.
Best,
Martin