-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ORDER BY multiple columns results in error when using ASC or DESC #35
Comments
Hi, |
Has there been any work on this? I would venture to say this is very common SQL syntax and not as unpopular as noted. In fact, both of the cited links do in fact make mention of the order by directionality, and provide examples of mixed column directionality. Perhaps, they didn't 2 years ago, though. I understand RBQL never becoming fully ANSI-SQL compatible, but I do feel like this syntax in particular is very commonly used. For example, say you have two CSV columns: "book title", and "read count". You want to sort the records with the highest read counts first (desc), then by the book titles, alphabetically (asc). As RBQL sits today, it's only accepting the directionality at the end of the |
Hello there,
Here are some examples:
The following all work:
SELECT * ORDER BY a.title DESC
SELECT * ORDER BY a.title, a.attribute
SELECT * ORDER BY a.title, a.attribute DESC
These result in an error:
SELECT * ORDER BY a.title ASC, a.attribute DESC
SELECT * ORDER BY a.title ASC, a.attribute
SELECT * ORDER BY a.title DESC, a.attribute
The error says:
Error while executing RBQL query!
Error type: "JS syntax error"
Details: Unexpected identifier
Is my syntax just incorrect?
I'm kinda questioning my sanity at this point and so googled for it, in SQL my syntax should work:
https://stackoverflow.com/questions/2051162/sql-multiple-column-ordering
top answer: 'ORDER BY column1 DESC, column2'
BR
Tobias
The text was updated successfully, but these errors were encountered: