Databases Reporting with SQL Ordering, Limiting and Paging Results Limiting Results

Raymond Moore
Raymond Moore
10,199 Points

SQL Query ?

I'm looking for a little assist on this one. I have been stuck for about 5 mins.

Steven Parker
Steven Parker
195,445 Points

Please show your query code so we can see what's happening.

Raymond Moore
Raymond Moore
10,199 Points

Hi Steven-

Actually I found out the problem was with syntax within the query. I forgot to place double quotes around the condition string value (e.g. SELECT * FROM books WHERE genre = 'Fantasy' ORDER BY first_published ASC LIMIT 5;)

I placed my initial issue in single quotes within the query. After reviewing a video from the basic SQL I then changed it to (i.e genre = "Fantasy").

However, thanks for the quick response :) Ray

1 Answer

Steven Parker
Steven Parker
195,445 Points

This is very strange, single quotes are actually correct for string literals, but double quotes are also accepted in some situations. For more details see this SQLite documentation page.

So I tried pasting your initial query (with the single quotes) directly into the challenge ... and it passed!

I can only think that there may have also been a typo that got fixed when you changed the quotes, but in any case, congratulations on resolving your issue. :+1: