Last answered:

16 Mar 2022

Posted on:

19 Nov 2021

0

Limit works while a where between clause doesn't?

I made my own subset B:
JOIN dept_emp de on e.emp_no = de.emp_no
WHERE e.emp_no between '110021' and '10040'
    GROUP BY e.emp_no
    ORDER BY e.emp_no
  ) AS B
23 records.
Next I tried:
JOIN dept_emp de on e.emp_no = de.emp_no
WHERE e.emp_no >'110021' and emp_ no < '10040'
    GROUP BY e.emp_no
    ORDER BY e.emp_no
  ) AS B
23 records.
I don't understand why a limit 20 brings back the correct number of rows while both where clauses fail.

3 answers ( 0 marked as helpful)
Instructor
Posted on:

16 Dec 2021

0

Hi Crystal!
Thanks for reaching out.

Could you please provide your question with more explanation? This can help us assist you better. Thank you.

Looking forward to your answer.
Best,
Tsvetelin

Posted on:

24 Dec 2021

0

Hi Crystal!
On the Where clause in your queries, it should be 10021 not 110021. I hope it helps. 

Instructor
Posted on:

16 Mar 2022

0

Hi Crystal and Thai!
Thanks for reaching out.
@: Thai
Thanks for sharing information with the Community!
@: Crystal
As Thai said you should change the range from 10021 to 10040.

Hope this helps.
Best,
Tsvetelin

Submit an answer