SELECT TOP(5) in MSSQL is pretty straightforward, I like this syntax the most among all databases.
New to Codewars and brushing off the rust on my programming skills. This was a good entry level for both as my first attempt. Thanks for the effort.
Can you post your sql query with a spoiler flag? Be aware there are several kinds of SQL dialects.
This kata is broken. Doesn't recognize the integer in TOP statement.
Tested and works just fine on an actual database/
This comment is hidden because it contains spoiler information about the solution
Select only necesary columns instead * is a good performance practice.
Also ensures you returns columns in an expected order.
Please mark your post as having spoiler content next time, maybe it's because how you used logic operators there, add parentheses or even better use IN like the instructions suggest.
"If you get more than 3, you will be kicked out, for being too smart". There is something in SQL that could be benefical for making sure you don't get kicked out for being too smart.
No problem, not in all SQL katas, but in this one you can change to SQLite, and it would have worked with double quotes too.
Thank you. Yes, I wasn't considering the first two a solution to the problem, just the most simple attempt to isolate a possible syntax. Thanks for pointing out about the quotes. I've never used PostgreSQL, so I'll have to learn more. Appreciate it!
The first 2 are wrong, and in all (but the last one is better), you're using the wrong kind of quotes. Note the default selected language is PostgreSQL.