Databases Querying Relational Databases Set Operations Set Operations

Can't get question 2 for set questions.

why does the below not work?

select name from fruit where name > "L" union select name from vegetable where name > "L";

Any tips?

2 Answers

Sean M
Sean M
7,333 Points

I'd be more than happy to help. Are you able to link to the question?

Looks like Kris was able to help me resolve this. Thank you though!

KRIS NIKOLAISEN
KRIS NIKOLAISEN
54,201 Points

Having > "L" includes name from L to Z. You want < "L" for names A to K.

thanks for the help! It worked!

But I must admit I don't get why. Doesn;t it make sense that "name > "L" " represents letters greater than L? How does the logic work?