The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

BETWEEN query SQL

BETWEEN query SQL

Super Learner
0
Votes
1
Answer

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)

  1. However, the values that I am getting are only greater than 66000 and lesser than 70000.
  2. 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.
  3. 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.

Regards,
Archie

1 Answer

365 Team
0
Votes

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

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF