![]() ![]() This uses a correlated subquery which has the distinct advantage of working in SQL Server, MySQL, PostGres, etc. The above is valid syntax for SQL Server and all DBMS that have implemented CTEs. WHERE department.budget = max_budget.value You have SELECTMAX instead of SELECT MAX WITH max_budget(value) AS (SELECT MAX(budget) FROM department) This specific question suffers from two issues: The first and already addressed is that CTEs WITH don't exist in mysql. This is the SQL Server version but I guarantee whatever logic you're attempting could be simplified if you explained what you were attempting to do versus "code doesn't work" Star 1 Code Issues Pull requests My HackerRank solutions. TestNG, JSON Simple, Tagsoup, Google/Gson, HTTPCore, HTTPClient, XMLResolver, Jing, JUnit, Hamcrest. There is a limit set on the size of the code submission, which is 50kB. In the Select Question Type dialog box, under the Roles-based category, click on Database. Click on the Library tab on the home page and then click on the Create Question button. ERROR 1064 (42000) at line 1: You have an error in your SQL syntax check the manual that corresponds to your MySQL server version for the right syntax to. Steps to Create a Database Engineer Question. CPU time would account for all thread's execution time in total to determine the execution time. HackerRank supports Microsoft SQL, MySQL, Oracle, and DB2 databases. SELECT FROM department WHERE department. Note, these sql fiddles use the question that was a duplicate of this as it was at least more interesting to answer. Multi-threading in all major languages is supported. The above is valid syntax for SQL Server and all DBMS that have implemented CTEs. To make this work with MySQL, you'll need to rewrite it as derived tables. MySQL doesn't support Common Table Expressions (CTE) so either your mysql tag is incorrect or you've pulled this syntax from nowhere. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |