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
hi maybe im not doing something wrong but i have complicated query with with defined in sub query, and compiled query is missing with part
minimal changed docs example
var activePosts = new Query("Comments")
.Select("PostId")
.SelectRaw("count(1) as Count")
.GroupBy("PostId")
.HavingRaw("count(1) > 100");
var queryWith = new Query("ActivePosts")
.With("ActivePosts", activePosts) // now you can consider ActivePosts as a regular table in the database
.Join("ActivePosts", "ActivePosts.PostId", "Posts.Id");
var query = new Query().From(queryWith);
result : SELECT * FROM ( SELECT * FROM [ActivePosts] INNER JOIN [ActivePosts] ON [ActivePosts].[PostId] = [Posts].[Id] )
WITH "ActivePosts" as is missing
The text was updated successfully, but these errors were encountered:
Here the From will not conserve the inner With, using an outer With will do.
This example should work.
varactivePosts=newQuery("Comments").Select("PostId").SelectRaw("count(1) as Count").GroupBy("PostId").HavingRaw("count(1) > 100");varqueryWith=newQuery("ActivePosts").With("ActivePosts",activePosts)// now you can consider ActivePosts as a regular table in the database.Join("ActivePosts","ActivePosts.PostId","Posts.Id");varquery=newQuery().With("sub",queryWith).From("sub");
hi maybe im not doing something wrong but i have complicated query with
with
defined in sub query, and compiled query is missingwith
partminimal changed docs example
result :
SELECT * FROM ( SELECT * FROM [ActivePosts] INNER JOIN [ActivePosts] ON [ActivePosts].[PostId] = [Posts].[Id] )
WITH "ActivePosts" as
is missingThe text was updated successfully, but these errors were encountered: