-
Notifications
You must be signed in to change notification settings - Fork 126
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
Question: why to order by a field, it needs to be in the select? #963
Comments
We purposely have added this validation when composing a SQL statement. Have you tried including the |
In short, the query below is not feasible.
But the query below would work.
EDITED: Or, maybe, I am combining the sub query selections and other providers 😄 |
Right, this is really a bug on the code. We will issue a fix for you, but we are glad if you can PR this simple fix. It sounds like we need to remove the line 726-740, and also, the one in the Once fixed (either via PR or us), we will issue the release for you immediately. Looking forward if you can PR this one mate. |
@SergerGood made the PR for this. The fix to this will be available the next releases > RepoDb v1.12.10-beta1. |
The fix for this is at PR #985 |
#963 Fixes for the PGSQL, MYSQL and SQLITE extended libraries
Hi,
I'm using SQL Server and I have queries that make certain fields select and order by another
exemple:
base.Query<TEntity>(TableName(), fields: Field.From("Id", "Name"), orderBy: new List<OrderField>() { new OrderField("Created", Order.Descending) });
Throw exception here:
https://github.com/mikependon/RepoDB/blob/master/RepoDb.Core/RepoDb/StatementBuilders/BaseStatementBuilder.cs#L727
because without that it works too. What is the reason for this?
The text was updated successfully, but these errors were encountered: