-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
Where exists remove select component #581
Comments
What is the advantage of passing a select in so to answer your question, SqlKata remove the SELECT part to reduce the query size |
The exists run the subquery to test for the existence of rows as you said. But, in the select you could do a lot of semantic operations like except, unions, other exists to check the existance, etc... to know if exists some records. In fact, through the addComponent, it works. |
@xPudda now you can set the |
Thank you so much! |
Why in the WhereExists method there is a line of code that remove the select component and apply always a 1 costant?
querybuilder/QueryBuilder/Base.Where.cs
Lines 541 to 545 in be679a9
I'm using SqlServer and I need to write an exists that through an except check some data.
In SqlServer it should be like this:
Translated in SqlKata it should be:
And the query is exactly the same as the sql. But actually, that line of code remove my select and apply 1:
As a workaround, i could use AddComponent method and pass the same new query as passed in the WhereNotExists and it works.
I think that line of code should be removed because it is wrong, let the outside decide what to select.
The text was updated successfully, but these errors were encountered: