-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
No table is set Exception #123
Comments
Could you elaborate more on the use case where you want this ? |
closing since long time with no reply, feel free to reopen if this still an issue for you |
@ahmad-moussawi I am populating a model in the format public class SomeStatsObject {
public int ThingsAlphaCount { get; set; }
public int ThingsBetaCount { get; set; }
public int ThingsGammaCount { get; set; }
public int ThingsDeltaCount { get; set; }
} that gets counts from a bunch of complex subqueries in the form of: SELECT
(SELECT COUNT (*) ...) ThingsAlphaCount,
(SELECT COUNT (*) ...) ThingsBetaCount,
(SELECT COUNT (DISTINCT *) ...) ThingsGammaCount,
(SELECT COUNT (*) ...) ThingsDeltaCount, I believe subqueries get what I need so my Sql Kata follows var thingsAlphaCountSubQuery = new Query(); // example for type info
var mainQuery = new Query()
.Select(thingsAlphaCountSubQuery, nameof(SomeStatsObject.ThingsAlphaCount))
.Select(thingsBetaCountSubQuery, nameof(SomeStatsObject.ThingsBetaCount))
.Select(thingsGammaCountSubQuery, nameof(SomeStatsObject.ThingsGammaCount))
.Select(thingsDeltaCountSubQuery, nameof(SomeStatsObject.ThingsDeltaCount));
var compiledQuery = new SqlServerCompiler().Compile(new[] { someRawQueryForParams, mainQuery }); Thus, I get the 'No table is set' exception. |
Or when using "CROSS APPLY" for column reuse within the same query |
Similar issue as OP, would be nice to be able to run |
@xavierzwirtz |
@ahmad-moussawi Could this be reopened? This is still an ongoing issue when compiling for SqlServer. |
just curious if you able to tackle cross apply or outer apply with column reuse only |
Guys, you can just inherit your copiler class eg.
now query: |
this is really great.. |
Hi
We can have a query without 'from' like:
querybuilder/QueryBuilder/Compilers/Compiler.cs
Line 415 in bd8aa43
The text was updated successfully, but these errors were encountered: