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
exec sp_executesql N'SELECT DISTINCT [tdProductTypes].[IsStock], [tdProductVariants].[MainVariantID] FROM [tdProducts]
INNER JOIN [tdProductTypes] ON [tdProductTypes].[ProductTypeID] = [tdProducts].[ProductType]
INNER JOIN [tdProductVariants] ON [tdProductVariants].[ProductID] = [tdProducts].[ProductID]
INNER JOIN [tdDimensionCombinations] ON [tdDimensionCombinations].[VariantID] = [tdProductVariants].[VariantID]
INNER JOIN [tdDimensions] ON ([tdDimensions].[DimensionID] = [tdDimensionCombinations].[DimensionID] AND NULLIF(tdDimensions.scnlDimensionUnit, 0) IS NOT NULL)
INNER JOIN [tdDimensionValues] ON ([tdDimensionValues].[DimensionID] = [tdDimensions].[DimensionID] AND [tdDimensionValues].[ValueID] = [tdDimensionCombinations].[DimensionValueID] AND NULLIF(tdDimensionValues.scnlBottleroom, 0) IS NOT NULL) WHERE [tdProducts].[ProductID] = @p0
ORDER BY (SELECT 0) OFFSET @p1 ROWS FETCH NEXT @p2 ROWS ONLY',N'@p0 int,@p1 bigint,@p2 int',@p0=1974,@p1=0,@p2=1
The Order By is added with a 'SELECT 0' which is invalid. I added myself a .OrderBy and everything works fine. In 3.7 this worked fine.
The text was updated successfully, but these errors were encountered:
nielslucas
changed the title
2.4 DISTINCT FirstOrDefault without Order By defined adds wrong Order BY statement - SqlServerCompiler
2.4.0 DISTINCT FirstOrDefault without Order By defined adds wrong Order BY statement - SqlServerCompiler
Nov 30, 2022
Query:
Result:
The Order By is added with a 'SELECT 0' which is invalid. I added myself a .OrderBy and everything works fine. In 3.7 this worked fine.
The text was updated successfully, but these errors were encountered: