You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example: var videos = new Videos(); var headlines = videos.All(where: "headline = @0", orderBy: "create DESC", limit: 5, columns: "videoid", args: 1);
Create a SQL query like "SELECT TOP 5 videoid FROM videos WHERE headline = 1 ORDER BY create DESC;", which MySQL throws the following error:
/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5 videoid FROM videos WHERE headline = 1 ORDER BY create DESC' at line 1 */
Workaround using Linq:
var videos = new Videos(); var headlines = videos.All(where: "headline = @0", orderBy: "create DESC", columns: "videoid", args: 1).Take(5);
The text was updated successfully, but these errors were encountered:
Right - this isn't an issue, it's a given. Remember, this is a code file - not a DLL or toolset. If you're using MySQL, you'll need LIMIT instead of TOP.
Example:
var videos = new Videos(); var headlines = videos.All(where: "headline = @0", orderBy: "
createDESC", limit: 5, columns: "videoid", args: 1);
Create a SQL query like "SELECT TOP 5 videoid FROM videos WHERE headline = 1 ORDER BY
create
DESC;", which MySQL throws the following error:/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5 videoid FROM videos WHERE headline = 1 ORDER BY
create
DESC' at line 1 */Workaround using Linq:
var videos = new Videos(); var headlines = videos.All(where: "headline = @0", orderBy: "
createDESC", columns: "videoid", args: 1).Take(5);
The text was updated successfully, but these errors were encountered: