Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAnand Suman
307 PointsHi Team, I ran the query to get the distinct name from Fruit and Vegetable tables having name starting with A through K
select name from Fruit where name like '[A-Z]%' union select name from Vegetable where name like '[A-Z]%';
Above query seems good to me but not working, Could you please have a look into this?
2 Answers
Andreas Frost Nordstrøm-Hansen
2,443 PointsRemember you need between A and K. So you need to set it to "A" AND "L".
It will not count K as in between. So you have to make it L instead.
So this should work.
SELECT Name FROM Fruit WHERE Name BETWEEN "A" AND "L" UNION SELECT Name FROM Vegetable WHERE Name BETWEEN "A" AND "L";
Andreas Frost Nordstrøm-Hansen
2,443 PointsYou have to use the BETWEEN keyword here.
Try with that. Reply again if you dont know what the correct code is, i can paste that aswell. But try and give it a go first.
Dino Heras
8,381 PointsDino Heras
8,381 PointsThank you!
Andreas Frost Nordstrøm-Hansen
2,443 PointsAndreas Frost Nordstrøm-Hansen
2,443 PointsRemember to vote best answer if it worked, so ohter people can find it quickly :)
Good Luck!