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 trialJonas Moltumyr
1,939 PointsSQL basic, bug in code challenger? where clause
I dont get what's wrong with this query... Just a bug in the code challenger?
6 Answers
jason chan
31,009 PointsSELECT * FROM users WHERE last_name = "Hinkley" or last_name = "Pettit";
jason chan
31,009 PointsCould you please post the question your having problems with?
Jason Anders
Treehouse Moderator 145,860 PointsHey Jonas,
You'll need to post you code, and it's best to post from the quiz / challenge you are in.
Just click the "Get Help" link from the video / challenge / quiz you are in... make sure "include code" is checked.
This way the community will be able to help you.
Jonas Moltumyr
1,939 PointsI actually did that, wonder why it did not display. Anyway
Question: Challenge Task 2 of 2
Now we're in the e-commerce database. In the users table we have the columns id, username, password, first_name and last_name. Find all users with either the last name "Hinkley" or "Pettit"
SELECT * FROM users WHERE last_name = "Hinkley" OR "Pettit"
Jason Anders
Treehouse Moderator 145,860 PointsIt seems you are missing your ending semicolon ;
Jonas Moltumyr
1,939 PointsSQL does not require you to have a semicolon at the end? It did not make a change either.
Here is the error I get from the code challenger:
Bummer! Did you select from the users
table and test the last_name
column?
Jason Anders
Treehouse Moderator 145,860 PointsCould you post the link to the actual quiz / challenge?
jason chan
31,009 Pointsending semicolon means the statement ends. It's a programming thing. The only languages that dont' have that are python or ruby.
Jason Anders
Treehouse Moderator 145,860 Pointscorrect! Semicolons are required with SQL. RE: W3SCHOOLS.
Jonas Moltumyr
1,939 PointsI do know my basic SQL, and have been writing queries for 4-5 years, and have never used semicolon at the end. So guess both works, have just been writing queries in SQL management Studio. Might be some function there that understands when the query is ending?
Jonas Moltumyr
1,939 PointsOkey, Guess I haven't been working with databases that requires the semicolon then. Good thing, learned something new today as well :)
That is mainly why I'm taking this SQL Basic course. Might pick up a thing or two ;)
Jonas Moltumyr
1,939 PointsJonas Moltumyr
1,939 PointsOf course...
Seems that I should go to sleep, my head not working properly now! Thanks anyway! :)