From c73e9973ad8723c8388196396bf9ffdc317f6b03 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 16:07:09 +0000 Subject: [PATCH 01/30] [Linux / PostgreSQL 13] baselines --- ....DistinctBy(PostgreSQL.13.LinqService).sql | 42 +++++++++++++++++++ ...geOverloads(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...FrameGroups(PostgreSQL.13.LinqService).sql | 13 ++++++ ...angeNoValue(PostgreSQL.13.LinqService).sql | 11 +++++ ...eRangeValue(PostgreSQL.13.LinqService).sql | 9 ++++ ...s.FrameRows(PostgreSQL.13.LinqService).sql | 13 ++++++ ...axOverloads(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...inOverloads(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...ePartitions(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++ ...centileCont(PostgreSQL.13.LinqService).sql | 10 +++++ ...ontGrouping(PostgreSQL.13.LinqService).sql | 14 +++++++ ...gProjection(PostgreSQL.13.LinqService).sql | 26 ++++++++++++ ...ileSubquery(PostgreSQL.13.LinqService).sql | 17 ++++++++ ...ePartitions(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++ ...umOverloads(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.13.LinqService).sql | 21 ++++++++++ ...tinctByTests.DistinctBy(PostgreSQL.13).sql | 42 +++++++++++++++++++ ...sTests.AverageOverloads(PostgreSQL.13).sql | 21 ++++++++++ ...erageOverloadsViaWindow(PostgreSQL.13).sql | 21 ++++++++++ ...ctionsTests.FrameGroups(PostgreSQL.13).sql | 13 ++++++ ...Tests.FrameRangeNoValue(PostgreSQL.13).sql | 11 +++++ ...nsTests.FrameRangeValue(PostgreSQL.13).sql | 9 ++++ ...unctionsTests.FrameRows(PostgreSQL.13).sql | 13 ++++++ ...tionsTests.MaxOverloads(PostgreSQL.13).sql | 21 ++++++++++ ...s.MaxOverloadsViaWindow(PostgreSQL.13).sql | 21 ++++++++++ ...tionsTests.MinOverloads(PostgreSQL.13).sql | 21 ++++++++++ ...s.MinOverloadsViaWindow(PostgreSQL.13).sql | 21 ++++++++++ ...eWithMultiplePartitions(PostgreSQL.13).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.13).sql | 34 +++++++++++++++ ...s.NTileWithoutPartition(PostgreSQL.13).sql | 34 +++++++++++++++ ...onsTests.PercentileCont(PostgreSQL.13).sql | 20 +++++++++ ....PercentileContGrouping(PostgreSQL.13).sql | 14 +++++++ ...eContGroupingProjection(PostgreSQL.13).sql | 26 ++++++++++++ ...ests.PercentileSubquery(PostgreSQL.13).sql | 17 ++++++++ ...rWithMultiplePartitions(PostgreSQL.13).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.13).sql | 34 +++++++++++++++ ...wNumberWithoutPartition(PostgreSQL.13).sql | 34 +++++++++++++++ ...tionsTests.SumOverloads(PostgreSQL.13).sql | 21 ++++++++++ ...s.SumOverloadsViaWindow(PostgreSQL.13).sql | 21 ++++++++++ 46 files changed, 1064 insertions(+) create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13).sql diff --git a/PostgreSQL.13.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..55f6fd9f453f --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..706883e69434 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..706883e69434 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..2eb7e110c3d2 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..778f373d6489 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..eea8ec29b09b --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13.LinqService).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..a866b13acf16 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..016937450ae3 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..016937450ae3 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..2b8413afd9bc --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..2b8413afd9bc --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..4b50d97c16be --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..858f2e1aa30d --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..12312c17a09d --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..4e4563a2a9a7 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..14f1237a7606 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13.LinqService).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..38d864784b11 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..f099ac2010fa --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..79aa4dc587e3 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..57229da7a64a --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..314cf73d4827 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..59793fd5a708 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..59793fd5a708 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13).sql new file mode 100644 index 000000000000..55f6fd9f453f --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13).sql new file mode 100644 index 000000000000..706883e69434 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..706883e69434 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13).sql new file mode 100644 index 000000000000..2eb7e110c3d2 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.13).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13).sql new file mode 100644 index 000000000000..778f373d6489 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.13).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13).sql new file mode 100644 index 000000000000..eea8ec29b09b --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.13).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13).sql new file mode 100644 index 000000000000..a866b13acf16 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.13).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13).sql new file mode 100644 index 000000000000..016937450ae3 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..016937450ae3 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13).sql new file mode 100644 index 000000000000..2b8413afd9bc --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..2b8413afd9bc --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13).sql new file mode 100644 index 000000000000..4b50d97c16be --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..858f2e1aa30d --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13).sql new file mode 100644 index 000000000000..12312c17a09d --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13).sql new file mode 100644 index 000000000000..beb4466bc3d7 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.13).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13).sql new file mode 100644 index 000000000000..14f1237a7606 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.13).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13).sql new file mode 100644 index 000000000000..38d864784b11 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.13).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13).sql new file mode 100644 index 000000000000..f099ac2010fa --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.13).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13).sql new file mode 100644 index 000000000000..79aa4dc587e3 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..57229da7a64a --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13).sql new file mode 100644 index 000000000000..314cf73d4827 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13).sql new file mode 100644 index 000000000000..59793fd5a708 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..59793fd5a708 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + From a8fc7874d267e9ae994a7c6038dad5a8dab47b92 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 16:07:12 +0000 Subject: [PATCH 02/30] [Linux / PostgreSQL 14] baselines --- ....DistinctBy(PostgreSQL.14.LinqService).sql | 42 +++++++++++++++++++ ...geOverloads(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...FrameGroups(PostgreSQL.14.LinqService).sql | 13 ++++++ ...angeNoValue(PostgreSQL.14.LinqService).sql | 11 +++++ ...eRangeValue(PostgreSQL.14.LinqService).sql | 9 ++++ ...s.FrameRows(PostgreSQL.14.LinqService).sql | 13 ++++++ ...axOverloads(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...inOverloads(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...ePartitions(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++ ...centileCont(PostgreSQL.14.LinqService).sql | 10 +++++ ...ontGrouping(PostgreSQL.14.LinqService).sql | 14 +++++++ ...gProjection(PostgreSQL.14.LinqService).sql | 26 ++++++++++++ ...ileSubquery(PostgreSQL.14.LinqService).sql | 17 ++++++++ ...ePartitions(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++ ...umOverloads(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.14.LinqService).sql | 21 ++++++++++ ...tinctByTests.DistinctBy(PostgreSQL.14).sql | 42 +++++++++++++++++++ ...sTests.AverageOverloads(PostgreSQL.14).sql | 21 ++++++++++ ...erageOverloadsViaWindow(PostgreSQL.14).sql | 21 ++++++++++ ...ctionsTests.FrameGroups(PostgreSQL.14).sql | 13 ++++++ ...Tests.FrameRangeNoValue(PostgreSQL.14).sql | 11 +++++ ...nsTests.FrameRangeValue(PostgreSQL.14).sql | 9 ++++ ...unctionsTests.FrameRows(PostgreSQL.14).sql | 13 ++++++ ...tionsTests.MaxOverloads(PostgreSQL.14).sql | 21 ++++++++++ ...s.MaxOverloadsViaWindow(PostgreSQL.14).sql | 21 ++++++++++ ...tionsTests.MinOverloads(PostgreSQL.14).sql | 21 ++++++++++ ...s.MinOverloadsViaWindow(PostgreSQL.14).sql | 21 ++++++++++ ...eWithMultiplePartitions(PostgreSQL.14).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.14).sql | 34 +++++++++++++++ ...s.NTileWithoutPartition(PostgreSQL.14).sql | 34 +++++++++++++++ ...onsTests.PercentileCont(PostgreSQL.14).sql | 20 +++++++++ ....PercentileContGrouping(PostgreSQL.14).sql | 14 +++++++ ...eContGroupingProjection(PostgreSQL.14).sql | 26 ++++++++++++ ...ests.PercentileSubquery(PostgreSQL.14).sql | 17 ++++++++ ...rWithMultiplePartitions(PostgreSQL.14).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.14).sql | 34 +++++++++++++++ ...wNumberWithoutPartition(PostgreSQL.14).sql | 34 +++++++++++++++ ...tionsTests.SumOverloads(PostgreSQL.14).sql | 21 ++++++++++ ...s.SumOverloadsViaWindow(PostgreSQL.14).sql | 21 ++++++++++ 46 files changed, 1064 insertions(+) create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14).sql diff --git a/PostgreSQL.14.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..19d2d63e0792 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..b006719ac262 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..b006719ac262 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..3d597bafe4f9 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..09776cc718ab --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..7b3e6ffb87f6 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14.LinqService).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..341e378bab23 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..7f66c63bab08 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..7f66c63bab08 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..a4ff001c2b74 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..a4ff001c2b74 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..9e82017cd794 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..2c019af6f4ab --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..acb6577fb58f --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..68a24ff2c4f7 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..4dfc394d95ce --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14.LinqService).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..bf905887350e --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..c1bc25ae3bcf --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..5e761c00d4b2 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..3a667faa240b --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..a7513b8e9202 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..b69c0fe4de1b --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..b69c0fe4de1b --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14).sql new file mode 100644 index 000000000000..19d2d63e0792 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14).sql new file mode 100644 index 000000000000..b006719ac262 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..b006719ac262 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14).sql new file mode 100644 index 000000000000..3d597bafe4f9 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.14).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14).sql new file mode 100644 index 000000000000..09776cc718ab --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.14).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14).sql new file mode 100644 index 000000000000..7b3e6ffb87f6 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.14).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14).sql new file mode 100644 index 000000000000..341e378bab23 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.14).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14).sql new file mode 100644 index 000000000000..7f66c63bab08 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..7f66c63bab08 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14).sql new file mode 100644 index 000000000000..a4ff001c2b74 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..a4ff001c2b74 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14).sql new file mode 100644 index 000000000000..9e82017cd794 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..2c019af6f4ab --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14).sql new file mode 100644 index 000000000000..acb6577fb58f --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14).sql new file mode 100644 index 000000000000..6285d199a6a6 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.14).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14).sql new file mode 100644 index 000000000000..4dfc394d95ce --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.14).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14).sql new file mode 100644 index 000000000000..bf905887350e --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.14).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14).sql new file mode 100644 index 000000000000..c1bc25ae3bcf --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.14).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14).sql new file mode 100644 index 000000000000..5e761c00d4b2 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..3a667faa240b --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14).sql new file mode 100644 index 000000000000..a7513b8e9202 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14).sql new file mode 100644 index 000000000000..b69c0fe4de1b --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..b69c0fe4de1b --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + From e2d43002c841f3faea5458eea07ef18ac8735f7f Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 16:07:16 +0000 Subject: [PATCH 03/30] [Linux / PostgreSQL 15] baselines --- ....DistinctBy(PostgreSQL.15.LinqService).sql | 42 +++++++++++++++++++ ...geOverloads(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...FrameGroups(PostgreSQL.15.LinqService).sql | 13 ++++++ ...angeNoValue(PostgreSQL.15.LinqService).sql | 11 +++++ ...eRangeValue(PostgreSQL.15.LinqService).sql | 9 ++++ ...s.FrameRows(PostgreSQL.15.LinqService).sql | 13 ++++++ ...axOverloads(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...inOverloads(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...ePartitions(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++ ...centileCont(PostgreSQL.15.LinqService).sql | 10 +++++ ...ontGrouping(PostgreSQL.15.LinqService).sql | 14 +++++++ ...gProjection(PostgreSQL.15.LinqService).sql | 26 ++++++++++++ ...ileSubquery(PostgreSQL.15.LinqService).sql | 17 ++++++++ ...ePartitions(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++ ...umOverloads(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.15.LinqService).sql | 21 ++++++++++ ...tinctByTests.DistinctBy(PostgreSQL.15).sql | 42 +++++++++++++++++++ ...sTests.AverageOverloads(PostgreSQL.15).sql | 21 ++++++++++ ...erageOverloadsViaWindow(PostgreSQL.15).sql | 21 ++++++++++ ...ctionsTests.FrameGroups(PostgreSQL.15).sql | 13 ++++++ ...Tests.FrameRangeNoValue(PostgreSQL.15).sql | 11 +++++ ...nsTests.FrameRangeValue(PostgreSQL.15).sql | 9 ++++ ...unctionsTests.FrameRows(PostgreSQL.15).sql | 13 ++++++ ...tionsTests.MaxOverloads(PostgreSQL.15).sql | 21 ++++++++++ ...s.MaxOverloadsViaWindow(PostgreSQL.15).sql | 21 ++++++++++ ...tionsTests.MinOverloads(PostgreSQL.15).sql | 21 ++++++++++ ...s.MinOverloadsViaWindow(PostgreSQL.15).sql | 21 ++++++++++ ...eWithMultiplePartitions(PostgreSQL.15).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.15).sql | 34 +++++++++++++++ ...s.NTileWithoutPartition(PostgreSQL.15).sql | 34 +++++++++++++++ ...onsTests.PercentileCont(PostgreSQL.15).sql | 20 +++++++++ ....PercentileContGrouping(PostgreSQL.15).sql | 14 +++++++ ...eContGroupingProjection(PostgreSQL.15).sql | 26 ++++++++++++ ...ests.PercentileSubquery(PostgreSQL.15).sql | 17 ++++++++ ...rWithMultiplePartitions(PostgreSQL.15).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.15).sql | 34 +++++++++++++++ ...wNumberWithoutPartition(PostgreSQL.15).sql | 34 +++++++++++++++ ...tionsTests.SumOverloads(PostgreSQL.15).sql | 21 ++++++++++ ...s.SumOverloadsViaWindow(PostgreSQL.15).sql | 21 ++++++++++ 46 files changed, 1064 insertions(+) create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15).sql diff --git a/PostgreSQL.15.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..5671ebabb274 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..be0b78be4cf1 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..be0b78be4cf1 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..6c70fdd3fb25 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..adb9964af64d --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..7db81eed46fa --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15.LinqService).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..baca4d818f5f --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..17e815521bd1 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..17e815521bd1 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..429abe89e03c --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..429abe89e03c --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..7383f9bc60d8 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..a448a00f9844 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..e01660169b82 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..29f2099c4316 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..49addeddda4b --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15.LinqService).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..a9eb0c73111b --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..3361e2795eeb --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..dc5a5c344b6c --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..92719c5b89ef --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..20506200dfd6 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..65311481bf13 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..65311481bf13 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15).sql new file mode 100644 index 000000000000..5671ebabb274 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15).sql new file mode 100644 index 000000000000..be0b78be4cf1 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..be0b78be4cf1 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15).sql new file mode 100644 index 000000000000..6c70fdd3fb25 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.15).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15).sql new file mode 100644 index 000000000000..adb9964af64d --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.15).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15).sql new file mode 100644 index 000000000000..7db81eed46fa --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.15).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15).sql new file mode 100644 index 000000000000..baca4d818f5f --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.15).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15).sql new file mode 100644 index 000000000000..17e815521bd1 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..17e815521bd1 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15).sql new file mode 100644 index 000000000000..429abe89e03c --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..429abe89e03c --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15).sql new file mode 100644 index 000000000000..7383f9bc60d8 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..a448a00f9844 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15).sql new file mode 100644 index 000000000000..e01660169b82 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15).sql new file mode 100644 index 000000000000..4afacc4eb56c --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.15).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15).sql new file mode 100644 index 000000000000..49addeddda4b --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.15).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15).sql new file mode 100644 index 000000000000..a9eb0c73111b --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.15).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15).sql new file mode 100644 index 000000000000..3361e2795eeb --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.15).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15).sql new file mode 100644 index 000000000000..dc5a5c344b6c --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..92719c5b89ef --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15).sql new file mode 100644 index 000000000000..20506200dfd6 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15).sql new file mode 100644 index 000000000000..65311481bf13 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..65311481bf13 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + From eb0ad076ccdf722fb098c7b6eabf4d8ba6a7a050 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 16:09:02 +0000 Subject: [PATCH 04/30] [Linux / PostgreSQL 17] baselines --- ....DistinctBy(PostgreSQL.17.LinqService).sql | 42 +++++++++++++++++++ ...geOverloads(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...FrameGroups(PostgreSQL.17.LinqService).sql | 13 ++++++ ...angeNoValue(PostgreSQL.17.LinqService).sql | 11 +++++ ...eRangeValue(PostgreSQL.17.LinqService).sql | 9 ++++ ...s.FrameRows(PostgreSQL.17.LinqService).sql | 13 ++++++ ...axOverloads(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...inOverloads(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...ePartitions(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++ ...centileCont(PostgreSQL.17.LinqService).sql | 10 +++++ ...ontGrouping(PostgreSQL.17.LinqService).sql | 14 +++++++ ...gProjection(PostgreSQL.17.LinqService).sql | 26 ++++++++++++ ...ileSubquery(PostgreSQL.17.LinqService).sql | 17 ++++++++ ...ePartitions(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++ ...umOverloads(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.17.LinqService).sql | 21 ++++++++++ ...tinctByTests.DistinctBy(PostgreSQL.17).sql | 42 +++++++++++++++++++ ...sTests.AverageOverloads(PostgreSQL.17).sql | 21 ++++++++++ ...erageOverloadsViaWindow(PostgreSQL.17).sql | 21 ++++++++++ ...ctionsTests.FrameGroups(PostgreSQL.17).sql | 13 ++++++ ...Tests.FrameRangeNoValue(PostgreSQL.17).sql | 11 +++++ ...nsTests.FrameRangeValue(PostgreSQL.17).sql | 9 ++++ ...unctionsTests.FrameRows(PostgreSQL.17).sql | 13 ++++++ ...tionsTests.MaxOverloads(PostgreSQL.17).sql | 21 ++++++++++ ...s.MaxOverloadsViaWindow(PostgreSQL.17).sql | 21 ++++++++++ ...tionsTests.MinOverloads(PostgreSQL.17).sql | 21 ++++++++++ ...s.MinOverloadsViaWindow(PostgreSQL.17).sql | 21 ++++++++++ ...eWithMultiplePartitions(PostgreSQL.17).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.17).sql | 34 +++++++++++++++ ...s.NTileWithoutPartition(PostgreSQL.17).sql | 34 +++++++++++++++ ...onsTests.PercentileCont(PostgreSQL.17).sql | 20 +++++++++ ....PercentileContGrouping(PostgreSQL.17).sql | 14 +++++++ ...eContGroupingProjection(PostgreSQL.17).sql | 26 ++++++++++++ ...ests.PercentileSubquery(PostgreSQL.17).sql | 17 ++++++++ ...rWithMultiplePartitions(PostgreSQL.17).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.17).sql | 34 +++++++++++++++ ...wNumberWithoutPartition(PostgreSQL.17).sql | 34 +++++++++++++++ ...tionsTests.SumOverloads(PostgreSQL.17).sql | 21 ++++++++++ ...s.SumOverloadsViaWindow(PostgreSQL.17).sql | 21 ++++++++++ 46 files changed, 1064 insertions(+) create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17).sql diff --git a/PostgreSQL.17.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..bd2c605b8d5e --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..8726d1b00186 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..8726d1b00186 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..64606383415a --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..f128df650293 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..984ea4e6e414 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17.LinqService).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..b9b5bb5854eb --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..ceee28cfa102 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..ceee28cfa102 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..c5118301a350 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..c5118301a350 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..1636912792f7 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..995977278b5d --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..693f14a36c75 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..512c0b7bd5ab --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..bee644cd269e --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17.LinqService).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..8cca653a7fcc --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..1b4ef80eeae8 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..4a1c8bfb9473 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..0a1767f9448c --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..b47d676f992c --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..8d31c3df5e4c --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..8d31c3df5e4c --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17).sql new file mode 100644 index 000000000000..bd2c605b8d5e --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17).sql new file mode 100644 index 000000000000..8726d1b00186 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..8726d1b00186 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17).sql new file mode 100644 index 000000000000..64606383415a --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.17).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17).sql new file mode 100644 index 000000000000..f128df650293 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.17).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17).sql new file mode 100644 index 000000000000..984ea4e6e414 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.17).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17).sql new file mode 100644 index 000000000000..b9b5bb5854eb --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.17).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17).sql new file mode 100644 index 000000000000..ceee28cfa102 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..ceee28cfa102 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17).sql new file mode 100644 index 000000000000..c5118301a350 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..c5118301a350 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17).sql new file mode 100644 index 000000000000..1636912792f7 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..995977278b5d --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17).sql new file mode 100644 index 000000000000..693f14a36c75 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17).sql new file mode 100644 index 000000000000..aa28c2856285 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.17).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17).sql new file mode 100644 index 000000000000..bee644cd269e --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.17).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17).sql new file mode 100644 index 000000000000..8cca653a7fcc --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.17).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17).sql new file mode 100644 index 000000000000..1b4ef80eeae8 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.17).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17).sql new file mode 100644 index 000000000000..4a1c8bfb9473 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..0a1767f9448c --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17).sql new file mode 100644 index 000000000000..b47d676f992c --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17).sql new file mode 100644 index 000000000000..8d31c3df5e4c --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..8d31c3df5e4c --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + From e0ec0ff3d05d41d3ee18fc7dc570a63bb5b2ec06 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 16:10:20 +0000 Subject: [PATCH 05/30] [Linux / PostgreSQL 16] baselines --- ....DistinctBy(PostgreSQL.16.LinqService).sql | 42 +++++++++++++++++++ ...geOverloads(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...FrameGroups(PostgreSQL.16.LinqService).sql | 13 ++++++ ...angeNoValue(PostgreSQL.16.LinqService).sql | 11 +++++ ...eRangeValue(PostgreSQL.16.LinqService).sql | 9 ++++ ...s.FrameRows(PostgreSQL.16.LinqService).sql | 13 ++++++ ...axOverloads(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...inOverloads(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...ePartitions(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++ ...centileCont(PostgreSQL.16.LinqService).sql | 10 +++++ ...ontGrouping(PostgreSQL.16.LinqService).sql | 14 +++++++ ...gProjection(PostgreSQL.16.LinqService).sql | 26 ++++++++++++ ...ileSubquery(PostgreSQL.16.LinqService).sql | 17 ++++++++ ...ePartitions(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++ ...efineWindow(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++ ...utPartition(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++ ...umOverloads(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...dsViaWindow(PostgreSQL.16.LinqService).sql | 21 ++++++++++ ...tinctByTests.DistinctBy(PostgreSQL.16).sql | 42 +++++++++++++++++++ ...sTests.AverageOverloads(PostgreSQL.16).sql | 21 ++++++++++ ...erageOverloadsViaWindow(PostgreSQL.16).sql | 21 ++++++++++ ...ctionsTests.FrameGroups(PostgreSQL.16).sql | 13 ++++++ ...Tests.FrameRangeNoValue(PostgreSQL.16).sql | 11 +++++ ...nsTests.FrameRangeValue(PostgreSQL.16).sql | 9 ++++ ...unctionsTests.FrameRows(PostgreSQL.16).sql | 13 ++++++ ...tionsTests.MaxOverloads(PostgreSQL.16).sql | 21 ++++++++++ ...s.MaxOverloadsViaWindow(PostgreSQL.16).sql | 21 ++++++++++ ...tionsTests.MinOverloads(PostgreSQL.16).sql | 21 ++++++++++ ...s.MinOverloadsViaWindow(PostgreSQL.16).sql | 21 ++++++++++ ...eWithMultiplePartitions(PostgreSQL.16).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.16).sql | 34 +++++++++++++++ ...s.NTileWithoutPartition(PostgreSQL.16).sql | 34 +++++++++++++++ ...onsTests.PercentileCont(PostgreSQL.16).sql | 20 +++++++++ ....PercentileContGrouping(PostgreSQL.16).sql | 14 +++++++ ...eContGroupingProjection(PostgreSQL.16).sql | 26 ++++++++++++ ...ests.PercentileSubquery(PostgreSQL.16).sql | 17 ++++++++ ...rWithMultiplePartitions(PostgreSQL.16).sql | 34 +++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.16).sql | 34 +++++++++++++++ ...wNumberWithoutPartition(PostgreSQL.16).sql | 34 +++++++++++++++ ...tionsTests.SumOverloads(PostgreSQL.16).sql | 21 ++++++++++ ...s.SumOverloadsViaWindow(PostgreSQL.16).sql | 21 ++++++++++ 46 files changed, 1064 insertions(+) create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16).sql diff --git a/PostgreSQL.16.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..867a1d950974 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..cd752e710694 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..cd752e710694 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..abcc0dd1aa74 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..35831b2668fe --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..2671dbff5067 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16.LinqService).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..592f83a39b35 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..d9d34447cffa --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..d9d34447cffa --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..7ed6949e2b24 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..7ed6949e2b24 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..8d0d38af03b5 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..ff5ae7c21e67 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..99ccb4301ec9 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..3a50c9209e46 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..a7b09d03d78a --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16.LinqService).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..a4f70e4efc32 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..81bd8758edb0 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..fe5ef35d7ab9 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..103ade906e8c --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..85b01264e5d5 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..a590d9857a9d --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..a590d9857a9d --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16).sql new file mode 100644 index 000000000000..867a1d950974 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16).sql new file mode 100644 index 000000000000..cd752e710694 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..cd752e710694 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16).sql new file mode 100644 index 000000000000..abcc0dd1aa74 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(PostgreSQL.16).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16).sql new file mode 100644 index 000000000000..35831b2668fe --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(PostgreSQL.16).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16).sql new file mode 100644 index 000000000000..2671dbff5067 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(PostgreSQL.16).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16).sql new file mode 100644 index 000000000000..592f83a39b35 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(PostgreSQL.16).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16).sql new file mode 100644 index 000000000000..d9d34447cffa --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..d9d34447cffa --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16).sql new file mode 100644 index 000000000000..7ed6949e2b24 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..7ed6949e2b24 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16).sql new file mode 100644 index 000000000000..8d0d38af03b5 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..ff5ae7c21e67 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16).sql new file mode 100644 index 000000000000..99ccb4301ec9 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16).sql new file mode 100644 index 000000000000..78ff8c788f3e --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(PostgreSQL.16).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @argument Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" t1 + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16).sql new file mode 100644 index 000000000000..a7b09d03d78a --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(PostgreSQL.16).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16).sql new file mode 100644 index 000000000000..a4f70e4efc32 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(PostgreSQL.16).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + g_2."Key_1", + t1.c1, + g_2.c1 +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."IntValue" DESC) as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 ON 1=1 + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16).sql new file mode 100644 index 000000000000..81bd8758edb0 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(PostgreSQL.16).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."CategoryId", + t1.c1 +FROM + "WindowFunctionTestEntity" t + LEFT JOIN LATERAL ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x."DecimalValue") as c1 + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 ON 1=1 + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16).sql new file mode 100644 index 000000000000..fe5ef35d7ab9 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..103ade906e8c --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16).sql new file mode 100644 index 000000000000..85b01264e5d5 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16).sql new file mode 100644 index 000000000000..a590d9857a9d --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..a590d9857a9d --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."ByteValue"::Int) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + From d3fa0ef2ba497f151f581e7db99ff0ea4fe6456d Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:22:22 +0000 Subject: [PATCH 06/30] [Windows / SQLite (specialized tests)] baselines --- ...inctBy(SQLite.Classic.MPM.LinqService).sql | 42 +++++++++++++++++++ ...ByTests.DistinctBy(SQLite.Classic.MPM).sql | 42 +++++++++++++++++++ ...inctBy(SQLite.Classic.MPU.LinqService).sql | 42 +++++++++++++++++++ ...ByTests.DistinctBy(SQLite.Classic.MPU).sql | 42 +++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 SQLite.Classic.MPM.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM.LinqService).sql create mode 100644 SQLite.Classic.MPM/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM).sql create mode 100644 SQLite.Classic.MPU.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU.LinqService).sql create mode 100644 SQLite.Classic.MPU/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU).sql diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..0548ced0dbd2 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..0548ced0dbd2 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..921d2755bc9c --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..921d2755bc9c --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + From 7c3cefcd38ceecb9e7f9702dfa0df46ff249893f Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:27:56 +0000 Subject: [PATCH 07/30] [Windows / SQLite (both providers)] baselines --- ...DistinctBy(SQLite.Classic.LinqService).sql | 42 +++++++++++++++++++ ...inctByTests.DistinctBy(SQLite.Classic).sql | 42 +++++++++++++++++++ ...ests.DistinctBy(SQLite.MS.LinqService).sql | 42 +++++++++++++++++++ ....DistinctByTests.DistinctBy(SQLite.MS).sql | 42 +++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 SQLite.Classic.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.LinqService).sql create mode 100644 SQLite.Classic/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic).sql create mode 100644 SQLite.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS.LinqService).sql create mode 100644 SQLite.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS).sql diff --git a/SQLite.Classic.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..4b8f646730cc --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic).sql new file mode 100644 index 000000000000..4b8f646730cc --- /dev/null +++ b/SQLite.Classic/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..a994ec801a87 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS).sql b/SQLite.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS).sql new file mode 100644 index 000000000000..a994ec801a87 --- /dev/null +++ b/SQLite.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + From 72d537e8e51d878aff63cdf0569cea74aa7ebd3a Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:31:42 +0000 Subject: [PATCH 08/30] [Windows / SQL Server 2014] baselines --- ...DistinctBy(SqlServer.2014.LinqService).sql | 42 +++++++++++++++++++ ...eOverloads(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...ngeNoValue(SqlServer.2014.LinqService).sql | 11 +++++ ....FrameRows(SqlServer.2014.LinqService).sql | 13 ++++++ ...xOverloads(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...nOverloads(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...entileCont(SqlServer.2014.LinqService).sql | 10 +++++ ...leSubquery(SqlServer.2014.LinqService).sql | 17 ++++++++ ...Partitions(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2014.LinqService).sql | 34 +++++++++++++++ ...mOverloads(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2014.LinqService).sql | 21 ++++++++++ ...tinctBy(SqlServer.2014.MS.LinqService).sql | 42 +++++++++++++++++++ ...erloads(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...NoValue(SqlServer.2014.MS.LinqService).sql | 11 +++++ ...ameRows(SqlServer.2014.MS.LinqService).sql | 13 ++++++ ...erloads(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...erloads(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...ileCont(SqlServer.2014.MS.LinqService).sql | 10 +++++ ...ubquery(SqlServer.2014.MS.LinqService).sql | 17 ++++++++ ...titions(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2014.MS.LinqService).sql | 34 +++++++++++++++ ...erloads(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2014.MS.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(SqlServer.2014.MS).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(SqlServer.2014.MS).sql | 21 ++++++++++ ...eOverloadsViaWindow(SqlServer.2014.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...istWithoutPartition(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...s.FrameRangeNoValue(SqlServer.2014.MS).sql | 11 +++++ ...ionsTests.FrameRows(SqlServer.2014.MS).sql | 13 ++++++ ...sTests.MaxOverloads(SqlServer.2014.MS).sql | 21 ++++++++++ ...xOverloadsViaWindow(SqlServer.2014.MS).sql | 21 ++++++++++ ...sTests.MinOverloads(SqlServer.2014.MS).sql | 21 ++++++++++ ...nOverloadsViaWindow(SqlServer.2014.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...ileWithoutPartition(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...ests.PercentileCont(SqlServer.2014.MS).sql | 20 +++++++++ ....PercentileSubquery(SqlServer.2014.MS).sql | 17 ++++++++ ...hMultiplePartitions(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...berWithoutPartition(SqlServer.2014.MS).sql | 34 +++++++++++++++ ...sTests.SumOverloads(SqlServer.2014.MS).sql | 21 ++++++++++ ...mOverloadsViaWindow(SqlServer.2014.MS).sql | 21 ++++++++++ ...inctByTests.DistinctBy(SqlServer.2014).sql | 42 +++++++++++++++++++ ...Tests.AverageOverloads(SqlServer.2014).sql | 21 ++++++++++ ...rageOverloadsViaWindow(SqlServer.2014).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2014).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2014).sql | 34 +++++++++++++++ ...meDistWithoutPartition(SqlServer.2014).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2014).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2014).sql | 34 +++++++++++++++ ...seRankWithoutPartition(SqlServer.2014).sql | 34 +++++++++++++++ ...ests.FrameRangeNoValue(SqlServer.2014).sql | 11 +++++ ...nctionsTests.FrameRows(SqlServer.2014).sql | 13 ++++++ ...ionsTests.MaxOverloads(SqlServer.2014).sql | 21 ++++++++++ ....MaxOverloadsViaWindow(SqlServer.2014).sql | 21 ++++++++++ ...ionsTests.MinOverloads(SqlServer.2014).sql | 21 ++++++++++ ....MinOverloadsViaWindow(SqlServer.2014).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2014).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2014).sql | 34 +++++++++++++++ ....NTileWithoutPartition(SqlServer.2014).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2014).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2014).sql | 34 +++++++++++++++ ...ntRankWithoutPartition(SqlServer.2014).sql | 34 +++++++++++++++ ...nsTests.PercentileCont(SqlServer.2014).sql | 20 +++++++++ ...sts.PercentileSubquery(SqlServer.2014).sql | 17 ++++++++ ...WithMultiplePartitions(SqlServer.2014).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2014).sql | 34 +++++++++++++++ ...s.RankWithoutPartition(SqlServer.2014).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2014).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2014).sql | 34 +++++++++++++++ ...NumberWithoutPartition(SqlServer.2014).sql | 34 +++++++++++++++ ...ionsTests.SumOverloads(SqlServer.2014).sql | 21 ++++++++++ ....SumOverloadsViaWindow(SqlServer.2014).sql | 21 ++++++++++ 124 files changed, 3512 insertions(+) create mode 100644 SqlServer.2014.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS).sql create mode 100644 SqlServer.2014/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014).sql create mode 100644 SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014).sql diff --git a/SqlServer.2014.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..96eaab30a949 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..15382d9d64ca --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..15382d9d64ca --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..6e88dc35cc76 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..726595207c01 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..e80bbd62c953 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..1c68c2c0acfd --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..7503405da849 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..150a349add24 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..b92e754b8105 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..d2d4582b760f --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..68eb08643c7c --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..68eb08643c7c --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..4d3e98de1360 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..4d3e98de1360 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..a0200c2b1fea --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..0aad83e5f084 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..cabbfc9533ff --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..932c10bd48fa --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..1450e1f9a90e --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..cd417e3d8cd2 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..a9bceefdd608 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2014 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..15215ad9ae7e --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..c423f994f02a --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..24acb4e39dfd --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..03700506477b --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..24e940fd7c31 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..db9a8772ee8c --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..26cfde25d790 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..75a2b8f4d5b3 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..75a2b8f4d5b3 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..4c1f90efaf13 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..b06a9ff24824 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..b06a9ff24824 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..cfd9895821bf --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..a10398449d3e --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..1d7922e64d30 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..575c8cac3e52 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..cf2c349467a4 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..2ae77ecc08da --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..3607b516a393 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..811db0d3bb27 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..2d81b0c1266a --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..2d81b0c1266a --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..85ab31e6c6c2 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..85ab31e6c6c2 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..de262caa86f4 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..22ac53c6361d --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..02066e8c2633 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..2cf2a127da48 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..2e8a637c71b9 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..5af80bcf2990 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..112db266ebed --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..e3f1aa334789 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..d3994cecf8a4 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..bf9144023ae6 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..0b74a3712c72 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..53e16db28fdb --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..ec63b1517477 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..914254a9be4a --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..1c0ef6180481 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..1c0ef6180481 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..4c1f90efaf13 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..b06a9ff24824 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..b06a9ff24824 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..cfd9895821bf --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..a10398449d3e --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..1d7922e64d30 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..575c8cac3e52 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..cf2c349467a4 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..2ae77ecc08da --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..3607b516a393 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..811db0d3bb27 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..2d81b0c1266a --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..2d81b0c1266a --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..85ab31e6c6c2 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..85ab31e6c6c2 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..de262caa86f4 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..22ac53c6361d --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..02066e8c2633 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..2cf2a127da48 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..2e8a637c71b9 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..5af80bcf2990 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..109f1de7fb2b --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..e3f1aa334789 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..d3994cecf8a4 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..bf9144023ae6 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..0b74a3712c72 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..53e16db28fdb --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..ec63b1517477 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..914254a9be4a --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..1c0ef6180481 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..1c0ef6180481 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014).sql new file mode 100644 index 000000000000..96eaab30a949 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014).sql new file mode 100644 index 000000000000..15382d9d64ca --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..15382d9d64ca --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014).sql new file mode 100644 index 000000000000..6e88dc35cc76 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..726595207c01 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014).sql new file mode 100644 index 000000000000..e80bbd62c953 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014).sql new file mode 100644 index 000000000000..1c68c2c0acfd --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..7503405da849 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014).sql new file mode 100644 index 000000000000..150a349add24 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014).sql new file mode 100644 index 000000000000..b92e754b8105 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2014).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014).sql new file mode 100644 index 000000000000..d2d4582b760f --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2014).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014).sql new file mode 100644 index 000000000000..68eb08643c7c --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..68eb08643c7c --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014).sql new file mode 100644 index 000000000000..4d3e98de1360 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..4d3e98de1360 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014).sql new file mode 100644 index 000000000000..a0200c2b1fea --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..0aad83e5f084 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014).sql new file mode 100644 index 000000000000..cabbfc9533ff --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014).sql new file mode 100644 index 000000000000..932c10bd48fa --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..1450e1f9a90e --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014).sql new file mode 100644 index 000000000000..cd417e3d8cd2 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014).sql new file mode 100644 index 000000000000..439879c96b5d --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2014).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2014 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2014 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014).sql new file mode 100644 index 000000000000..15215ad9ae7e --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2014).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014).sql new file mode 100644 index 000000000000..c423f994f02a --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..24acb4e39dfd --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014).sql new file mode 100644 index 000000000000..03700506477b --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014).sql new file mode 100644 index 000000000000..24e940fd7c31 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..db9a8772ee8c --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014).sql new file mode 100644 index 000000000000..26cfde25d790 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2014).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014).sql new file mode 100644 index 000000000000..75a2b8f4d5b3 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014).sql new file mode 100644 index 000000000000..75a2b8f4d5b3 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2014).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + From 379de2478f398243fa11816530bbe508c96807ef Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:36:20 +0000 Subject: [PATCH 09/30] [Windows / SQL Server 2008] baselines --- ...DistinctBy(SqlServer.2008.LinqService).sql | 42 +++++++++++++++++++ ...tinctBy(SqlServer.2008.MS.LinqService).sql | 42 +++++++++++++++++++ ...tByTests.DistinctBy(SqlServer.2008.MS).sql | 42 +++++++++++++++++++ ...inctByTests.DistinctBy(SqlServer.2008).sql | 42 +++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 SqlServer.2008.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.LinqService).sql create mode 100644 SqlServer.2008.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS.LinqService).sql create mode 100644 SqlServer.2008.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS).sql create mode 100644 SqlServer.2008/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008).sql diff --git a/SqlServer.2008.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.LinqService).sql new file mode 100644 index 000000000000..7a8199a38f6b --- /dev/null +++ b/SqlServer.2008.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS.LinqService).sql new file mode 100644 index 000000000000..a57688902b48 --- /dev/null +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2008.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS).sql new file mode 100644 index 000000000000..a57688902b48 --- /dev/null +++ b/SqlServer.2008.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2008/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008).sql new file mode 100644 index 000000000000..7a8199a38f6b --- /dev/null +++ b/SqlServer.2008/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + From f73988138544562654613b423fa7defa0289e401 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:37:42 +0000 Subject: [PATCH 10/30] [Windows / SQL Server 2012] baselines --- ...DistinctBy(SqlServer.2012.LinqService).sql | 42 +++++++++++++++++++ ...eOverloads(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...ngeNoValue(SqlServer.2012.LinqService).sql | 11 +++++ ....FrameRows(SqlServer.2012.LinqService).sql | 13 ++++++ ...xOverloads(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...nOverloads(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...entileCont(SqlServer.2012.LinqService).sql | 10 +++++ ...leSubquery(SqlServer.2012.LinqService).sql | 17 ++++++++ ...Partitions(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2012.LinqService).sql | 34 +++++++++++++++ ...mOverloads(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2012.LinqService).sql | 21 ++++++++++ ...tinctBy(SqlServer.2012.MS.LinqService).sql | 42 +++++++++++++++++++ ...erloads(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...NoValue(SqlServer.2012.MS.LinqService).sql | 11 +++++ ...ameRows(SqlServer.2012.MS.LinqService).sql | 13 ++++++ ...erloads(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...erloads(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...ileCont(SqlServer.2012.MS.LinqService).sql | 10 +++++ ...ubquery(SqlServer.2012.MS.LinqService).sql | 17 ++++++++ ...titions(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2012.MS.LinqService).sql | 34 +++++++++++++++ ...erloads(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2012.MS.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(SqlServer.2012.MS).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(SqlServer.2012.MS).sql | 21 ++++++++++ ...eOverloadsViaWindow(SqlServer.2012.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...istWithoutPartition(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...s.FrameRangeNoValue(SqlServer.2012.MS).sql | 11 +++++ ...ionsTests.FrameRows(SqlServer.2012.MS).sql | 13 ++++++ ...sTests.MaxOverloads(SqlServer.2012.MS).sql | 21 ++++++++++ ...xOverloadsViaWindow(SqlServer.2012.MS).sql | 21 ++++++++++ ...sTests.MinOverloads(SqlServer.2012.MS).sql | 21 ++++++++++ ...nOverloadsViaWindow(SqlServer.2012.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...ileWithoutPartition(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...ests.PercentileCont(SqlServer.2012.MS).sql | 20 +++++++++ ....PercentileSubquery(SqlServer.2012.MS).sql | 17 ++++++++ ...hMultiplePartitions(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...berWithoutPartition(SqlServer.2012.MS).sql | 34 +++++++++++++++ ...sTests.SumOverloads(SqlServer.2012.MS).sql | 21 ++++++++++ ...mOverloadsViaWindow(SqlServer.2012.MS).sql | 21 ++++++++++ ...inctByTests.DistinctBy(SqlServer.2012).sql | 42 +++++++++++++++++++ ...Tests.AverageOverloads(SqlServer.2012).sql | 21 ++++++++++ ...rageOverloadsViaWindow(SqlServer.2012).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2012).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2012).sql | 34 +++++++++++++++ ...meDistWithoutPartition(SqlServer.2012).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2012).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2012).sql | 34 +++++++++++++++ ...seRankWithoutPartition(SqlServer.2012).sql | 34 +++++++++++++++ ...ests.FrameRangeNoValue(SqlServer.2012).sql | 11 +++++ ...nctionsTests.FrameRows(SqlServer.2012).sql | 13 ++++++ ...ionsTests.MaxOverloads(SqlServer.2012).sql | 21 ++++++++++ ....MaxOverloadsViaWindow(SqlServer.2012).sql | 21 ++++++++++ ...ionsTests.MinOverloads(SqlServer.2012).sql | 21 ++++++++++ ....MinOverloadsViaWindow(SqlServer.2012).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2012).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2012).sql | 34 +++++++++++++++ ....NTileWithoutPartition(SqlServer.2012).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2012).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2012).sql | 34 +++++++++++++++ ...ntRankWithoutPartition(SqlServer.2012).sql | 34 +++++++++++++++ ...nsTests.PercentileCont(SqlServer.2012).sql | 20 +++++++++ ...sts.PercentileSubquery(SqlServer.2012).sql | 17 ++++++++ ...WithMultiplePartitions(SqlServer.2012).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2012).sql | 34 +++++++++++++++ ...s.RankWithoutPartition(SqlServer.2012).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2012).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2012).sql | 34 +++++++++++++++ ...NumberWithoutPartition(SqlServer.2012).sql | 34 +++++++++++++++ ...ionsTests.SumOverloads(SqlServer.2012).sql | 21 ++++++++++ ....SumOverloadsViaWindow(SqlServer.2012).sql | 21 ++++++++++ 124 files changed, 3512 insertions(+) create mode 100644 SqlServer.2012.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS).sql create mode 100644 SqlServer.2012/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012).sql create mode 100644 SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012).sql diff --git a/SqlServer.2012.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..c7069a2363e6 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..f304012fc095 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..f304012fc095 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..9080034e47c0 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..2461dba22b1e --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..ca62f3758376 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..6f18176ed53d --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..73de15dd1954 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..634bb0e121fc --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..a68bf0ec88f3 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..04949777c403 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..40efa184ecb3 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..40efa184ecb3 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..55cfc39605f5 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..55cfc39605f5 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..a8326f09dc01 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..eda9820359e0 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..958920c3747b --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..df0956bb5a1b --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..177d787d6b2e --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..1f340c28d3c4 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..b2c71167d511 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2012 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..daa177a23c48 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..cde5976f0696 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..fa84eb238f5c --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..382020f636e0 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..40274f13ab42 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..1af5ba396083 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..c3f5c0c17d01 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..ef2437fcf21e --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..ef2437fcf21e --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..2d7895ea431f --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..8fa5ddb5fac8 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..8fa5ddb5fac8 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..cc7fb7aa0d29 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..a1a5d94443ec --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..f29455384f8d --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..85f014153893 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..0e4189d11c72 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..aec289eef2b9 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..1e48b3ac7de6 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..322e7f023bc0 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..883245764931 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..883245764931 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..a1f36d23bbb1 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..a1f36d23bbb1 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..f4bd73991b92 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..1ac1b49a563d --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..d48e2cb0d881 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..cd36ce2477fc --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..7c0fea25bbd0 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..caeab7a1f6a5 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..7cd2b3802da7 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..b41ea2be8c0b --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..e5d8d29edfb7 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..d3a4052d0822 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..bdc3e99f564b --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..97e50837883d --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..77aff1631d28 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..bb0daffbd9e3 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..fc92d3e7cb27 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..fc92d3e7cb27 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..2d7895ea431f --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..8fa5ddb5fac8 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..8fa5ddb5fac8 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..cc7fb7aa0d29 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..a1a5d94443ec --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..f29455384f8d --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..85f014153893 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..0e4189d11c72 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..aec289eef2b9 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..1e48b3ac7de6 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..322e7f023bc0 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..883245764931 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..883245764931 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..a1f36d23bbb1 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..a1f36d23bbb1 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..f4bd73991b92 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..1ac1b49a563d --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..d48e2cb0d881 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..cd36ce2477fc --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..7c0fea25bbd0 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..caeab7a1f6a5 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..d33156815b71 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..b41ea2be8c0b --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..e5d8d29edfb7 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..d3a4052d0822 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..bdc3e99f564b --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..97e50837883d --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..77aff1631d28 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..bb0daffbd9e3 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..fc92d3e7cb27 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..fc92d3e7cb27 --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012).sql new file mode 100644 index 000000000000..c7069a2363e6 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012).sql new file mode 100644 index 000000000000..f304012fc095 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..f304012fc095 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012).sql new file mode 100644 index 000000000000..9080034e47c0 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..2461dba22b1e --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012).sql new file mode 100644 index 000000000000..ca62f3758376 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012).sql new file mode 100644 index 000000000000..6f18176ed53d --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..73de15dd1954 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012).sql new file mode 100644 index 000000000000..634bb0e121fc --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012).sql new file mode 100644 index 000000000000..a68bf0ec88f3 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2012).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012).sql new file mode 100644 index 000000000000..04949777c403 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2012).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012).sql new file mode 100644 index 000000000000..40efa184ecb3 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..40efa184ecb3 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012).sql new file mode 100644 index 000000000000..55cfc39605f5 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..55cfc39605f5 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012).sql new file mode 100644 index 000000000000..a8326f09dc01 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..eda9820359e0 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012).sql new file mode 100644 index 000000000000..958920c3747b --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012).sql new file mode 100644 index 000000000000..df0956bb5a1b --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..177d787d6b2e --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012).sql new file mode 100644 index 000000000000..1f340c28d3c4 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012).sql new file mode 100644 index 000000000000..3fe40d2b6f72 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2012).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2012 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2012 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012).sql new file mode 100644 index 000000000000..daa177a23c48 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2012).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012).sql new file mode 100644 index 000000000000..cde5976f0696 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..fa84eb238f5c --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012).sql new file mode 100644 index 000000000000..382020f636e0 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012).sql new file mode 100644 index 000000000000..40274f13ab42 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..1af5ba396083 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012).sql new file mode 100644 index 000000000000..c3f5c0c17d01 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2012).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012).sql new file mode 100644 index 000000000000..ef2437fcf21e --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012).sql new file mode 100644 index 000000000000..ef2437fcf21e --- /dev/null +++ b/SqlServer.2012/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2012).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + From b6d3630a17e7d4b75b8b4673c0d447458d9a9bfe Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:39:38 +0000 Subject: [PATCH 11/30] [Windows / SQL Server 2016] baselines --- ...DistinctBy(SqlServer.2016.LinqService).sql | 42 +++++++++++++++++++ ...eOverloads(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...ngeNoValue(SqlServer.2016.LinqService).sql | 11 +++++ ....FrameRows(SqlServer.2016.LinqService).sql | 13 ++++++ ...xOverloads(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...nOverloads(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...entileCont(SqlServer.2016.LinqService).sql | 10 +++++ ...leSubquery(SqlServer.2016.LinqService).sql | 17 ++++++++ ...Partitions(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2016.LinqService).sql | 34 +++++++++++++++ ...mOverloads(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2016.LinqService).sql | 21 ++++++++++ ...tinctBy(SqlServer.2016.MS.LinqService).sql | 42 +++++++++++++++++++ ...erloads(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...NoValue(SqlServer.2016.MS.LinqService).sql | 11 +++++ ...ameRows(SqlServer.2016.MS.LinqService).sql | 13 ++++++ ...erloads(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...erloads(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...ileCont(SqlServer.2016.MS.LinqService).sql | 10 +++++ ...ubquery(SqlServer.2016.MS.LinqService).sql | 17 ++++++++ ...titions(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2016.MS.LinqService).sql | 34 +++++++++++++++ ...erloads(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2016.MS.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(SqlServer.2016.MS).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(SqlServer.2016.MS).sql | 21 ++++++++++ ...eOverloadsViaWindow(SqlServer.2016.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...istWithoutPartition(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...s.FrameRangeNoValue(SqlServer.2016.MS).sql | 11 +++++ ...ionsTests.FrameRows(SqlServer.2016.MS).sql | 13 ++++++ ...sTests.MaxOverloads(SqlServer.2016.MS).sql | 21 ++++++++++ ...xOverloadsViaWindow(SqlServer.2016.MS).sql | 21 ++++++++++ ...sTests.MinOverloads(SqlServer.2016.MS).sql | 21 ++++++++++ ...nOverloadsViaWindow(SqlServer.2016.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...ileWithoutPartition(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...ests.PercentileCont(SqlServer.2016.MS).sql | 20 +++++++++ ....PercentileSubquery(SqlServer.2016.MS).sql | 17 ++++++++ ...hMultiplePartitions(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...berWithoutPartition(SqlServer.2016.MS).sql | 34 +++++++++++++++ ...sTests.SumOverloads(SqlServer.2016.MS).sql | 21 ++++++++++ ...mOverloadsViaWindow(SqlServer.2016.MS).sql | 21 ++++++++++ ...inctByTests.DistinctBy(SqlServer.2016).sql | 42 +++++++++++++++++++ ...Tests.AverageOverloads(SqlServer.2016).sql | 21 ++++++++++ ...rageOverloadsViaWindow(SqlServer.2016).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2016).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2016).sql | 34 +++++++++++++++ ...meDistWithoutPartition(SqlServer.2016).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2016).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2016).sql | 34 +++++++++++++++ ...seRankWithoutPartition(SqlServer.2016).sql | 34 +++++++++++++++ ...ests.FrameRangeNoValue(SqlServer.2016).sql | 11 +++++ ...nctionsTests.FrameRows(SqlServer.2016).sql | 13 ++++++ ...ionsTests.MaxOverloads(SqlServer.2016).sql | 21 ++++++++++ ....MaxOverloadsViaWindow(SqlServer.2016).sql | 21 ++++++++++ ...ionsTests.MinOverloads(SqlServer.2016).sql | 21 ++++++++++ ....MinOverloadsViaWindow(SqlServer.2016).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2016).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2016).sql | 34 +++++++++++++++ ....NTileWithoutPartition(SqlServer.2016).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2016).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2016).sql | 34 +++++++++++++++ ...ntRankWithoutPartition(SqlServer.2016).sql | 34 +++++++++++++++ ...nsTests.PercentileCont(SqlServer.2016).sql | 20 +++++++++ ...sts.PercentileSubquery(SqlServer.2016).sql | 17 ++++++++ ...WithMultiplePartitions(SqlServer.2016).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2016).sql | 34 +++++++++++++++ ...s.RankWithoutPartition(SqlServer.2016).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2016).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2016).sql | 34 +++++++++++++++ ...NumberWithoutPartition(SqlServer.2016).sql | 34 +++++++++++++++ ...ionsTests.SumOverloads(SqlServer.2016).sql | 21 ++++++++++ ....SumOverloadsViaWindow(SqlServer.2016).sql | 21 ++++++++++ 124 files changed, 3512 insertions(+) create mode 100644 SqlServer.2016.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS).sql create mode 100644 SqlServer.2016/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016).sql create mode 100644 SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016).sql diff --git a/SqlServer.2016.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..cdea81afcd4e --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..0b9e4f24d818 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..0b9e4f24d818 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..4389bade0a92 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..32e4a3a77865 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..e355342351e0 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..a65a10fdf612 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..aa27bc2905e1 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..bacd51cfcd6f --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..1423fd250ffd --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..e956e99fc9b7 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..805e9f80b965 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..805e9f80b965 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..a6da86cc24fa --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..a6da86cc24fa --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..c0d15099bb4b --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..3c5c206d9685 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..ab83517f8c8e --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..b5c00fb43516 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..8e710d538968 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..8a2ff30fcaab --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..cd25de274899 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2016 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..ea2e45127fe0 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..1436f490dd79 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..431fb9e24b5f --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..3fbbbd2132e4 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..c42ae865444d --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..617af0dc3c02 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..878f2993ae6a --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..c6621c270d3b --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..c6621c270d3b --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..6b25c477f7d4 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..fbd56ae4c925 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..fbd56ae4c925 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..0d4c97f05654 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..bfb6a790d466 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..60a187755c24 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..fed71e90ea7f --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..bed791bf308c --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..74f3a3fc3208 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..62c5987de826 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..45a62673a41a --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..f2d0e4482598 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..f2d0e4482598 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..338f8f2a59b5 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..338f8f2a59b5 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..2da9e1951d4c --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..04d9d7d201f6 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..fa354492d7c0 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..25f8d926381d --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..024b77d78107 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..f8271cf3484f --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..b39e8f5397fe --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..f5add06e650d --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..496842fef355 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..7855fcd91cdb --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..eee366461e35 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..3bbf83e905db --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..5a4665265763 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..ad9461fa91c4 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..5735c0c95410 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..5735c0c95410 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..6b25c477f7d4 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..fbd56ae4c925 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..fbd56ae4c925 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..0d4c97f05654 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..bfb6a790d466 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..60a187755c24 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..fed71e90ea7f --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..bed791bf308c --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..74f3a3fc3208 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..62c5987de826 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..45a62673a41a --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..f2d0e4482598 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..f2d0e4482598 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..338f8f2a59b5 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..338f8f2a59b5 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..2da9e1951d4c --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..04d9d7d201f6 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..fa354492d7c0 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..25f8d926381d --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..024b77d78107 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..f8271cf3484f --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..bfb18b2a603a --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..f5add06e650d --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..496842fef355 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..7855fcd91cdb --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..eee366461e35 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..3bbf83e905db --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..5a4665265763 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..ad9461fa91c4 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..5735c0c95410 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..5735c0c95410 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016).sql new file mode 100644 index 000000000000..cdea81afcd4e --- /dev/null +++ b/SqlServer.2016/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016).sql new file mode 100644 index 000000000000..0b9e4f24d818 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..0b9e4f24d818 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016).sql new file mode 100644 index 000000000000..4389bade0a92 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..32e4a3a77865 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016).sql new file mode 100644 index 000000000000..e355342351e0 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016).sql new file mode 100644 index 000000000000..a65a10fdf612 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..aa27bc2905e1 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016).sql new file mode 100644 index 000000000000..bacd51cfcd6f --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016).sql new file mode 100644 index 000000000000..1423fd250ffd --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2016).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016).sql new file mode 100644 index 000000000000..e956e99fc9b7 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2016).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016).sql new file mode 100644 index 000000000000..805e9f80b965 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..805e9f80b965 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016).sql new file mode 100644 index 000000000000..a6da86cc24fa --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..a6da86cc24fa --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016).sql new file mode 100644 index 000000000000..c0d15099bb4b --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..3c5c206d9685 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016).sql new file mode 100644 index 000000000000..ab83517f8c8e --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016).sql new file mode 100644 index 000000000000..b5c00fb43516 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..8e710d538968 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016).sql new file mode 100644 index 000000000000..8a2ff30fcaab --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016).sql new file mode 100644 index 000000000000..48e144076793 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2016).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2016 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2016 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016).sql new file mode 100644 index 000000000000..ea2e45127fe0 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2016).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016).sql new file mode 100644 index 000000000000..1436f490dd79 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..431fb9e24b5f --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016).sql new file mode 100644 index 000000000000..3fbbbd2132e4 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016).sql new file mode 100644 index 000000000000..c42ae865444d --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..617af0dc3c02 --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016).sql new file mode 100644 index 000000000000..878f2993ae6a --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016).sql new file mode 100644 index 000000000000..c6621c270d3b --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016).sql new file mode 100644 index 000000000000..c6621c270d3b --- /dev/null +++ b/SqlServer.2016/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2016).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + From b4d33e5a3deedd83d787f24c713659d1aac6e136 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:42:50 +0000 Subject: [PATCH 12/30] [Linux / DB2 LUW 11.5] baselines --- ...nctByTests.DistinctBy(DB2.LinqService).sql | 42 +++++++++++++++++++ ...FirstOrDefaultScalar2(DB2.LinqService).sql | 2 +- ...s.Linq.DistinctByTests.DistinctBy(DB2).sql | 42 +++++++++++++++++++ ...Tests.NestedFirstOrDefaultScalar2(DB2).sql | 2 +- 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2.LinqService).sql create mode 100644 DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2).sql diff --git a/DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2.LinqService).sql b/DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2.LinqService).sql new file mode 100644 index 000000000000..95e759c67ac5 --- /dev/null +++ b/DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- DB2 DB2.LUW DB2LUW + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- DB2 DB2.LUW DB2LUW + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/DB2.LinqService/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2.LinqService).sql b/DB2.LinqService/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2.LinqService).sql index 9013b3384cc9..06c06a30baf8 100644 --- a/DB2.LinqService/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2.LinqService).sql +++ b/DB2.LinqService/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2.LinqService).sql @@ -9,7 +9,7 @@ FROM LEFT JOIN ( SELECT "c_1"."ChildID", - ROW_NUMBER() OVER (PARTITION BY "a_Parent"."ParentID", "a_Parent"."Value1" ORDER BY ("c_1"."ChildID" * "c_1"."ParentID") DESC) as "rn", + ROW_NUMBER() OVER (PARTITION BY "a_Parent"."ParentID", "a_Parent"."Value1" ORDER BY "c_1"."ChildID" * "c_1"."ParentID" DESC) as "rn", "a_Parent"."ParentID", "a_Parent"."Value1" FROM diff --git a/DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2).sql b/DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2).sql new file mode 100644 index 000000000000..95e759c67ac5 --- /dev/null +++ b/DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(DB2).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- DB2 DB2.LUW DB2LUW + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- DB2 DB2.LUW DB2LUW + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/DB2/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2).sql b/DB2/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2).sql index 9013b3384cc9..06c06a30baf8 100644 --- a/DB2/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2).sql +++ b/DB2/Tests/Linq/ElementOperationTests/Tests.Linq.ElementOperationTests.NestedFirstOrDefaultScalar2(DB2).sql @@ -9,7 +9,7 @@ FROM LEFT JOIN ( SELECT "c_1"."ChildID", - ROW_NUMBER() OVER (PARTITION BY "a_Parent"."ParentID", "a_Parent"."Value1" ORDER BY ("c_1"."ChildID" * "c_1"."ParentID") DESC) as "rn", + ROW_NUMBER() OVER (PARTITION BY "a_Parent"."ParentID", "a_Parent"."Value1" ORDER BY "c_1"."ChildID" * "c_1"."ParentID" DESC) as "rn", "a_Parent"."ParentID", "a_Parent"."Value1" FROM From 0d7d9804c16dcad6624de87ff32f46c17a7c2a99 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:47:56 +0000 Subject: [PATCH 13/30] [Linux / Firebird 4.0] baselines --- ...sts.DistinctBy(Firebird.4.LinqService).sql | 42 +++++++++++++++++++ ...DistinctByTests.DistinctBy(Firebird.4).sql | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 Firebird.4.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4.LinqService).sql create mode 100644 Firebird.4/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4).sql diff --git a/Firebird.4.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4.LinqService).sql b/Firebird.4.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4.LinqService).sql new file mode 100644 index 000000000000..ac0c887b17a5 --- /dev/null +++ b/Firebird.4.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/Firebird.4/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4).sql b/Firebird.4/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4).sql new file mode 100644 index 000000000000..ac0c887b17a5 --- /dev/null +++ b/Firebird.4/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.4).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + From 760a3477965b6ab292a413cb3c040554ab826061 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:47:57 +0000 Subject: [PATCH 14/30] [Linux / Firebird 3.0] baselines --- ...sts.DistinctBy(Firebird.3.LinqService).sql | 42 +++++++++++++++++++ ...DistinctByTests.DistinctBy(Firebird.3).sql | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 Firebird.3.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3.LinqService).sql create mode 100644 Firebird.3/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3).sql diff --git a/Firebird.3.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3.LinqService).sql b/Firebird.3.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3.LinqService).sql new file mode 100644 index 000000000000..048743a6f853 --- /dev/null +++ b/Firebird.3.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/Firebird.3/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3).sql b/Firebird.3/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3).sql new file mode 100644 index 000000000000..048743a6f853 --- /dev/null +++ b/Firebird.3/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.3).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + From 35e6e676f922409c6fe9460f4767a07a5506150f Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:51:33 +0000 Subject: [PATCH 15/30] [Linux / Firebird 5.0] baselines --- ...sts.DistinctBy(Firebird.5.LinqService).sql | 42 +++++++++++++++++++ ...DistinctByTests.DistinctBy(Firebird.5).sql | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 Firebird.5.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5.LinqService).sql create mode 100644 Firebird.5/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5).sql diff --git a/Firebird.5.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5.LinqService).sql b/Firebird.5.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5.LinqService).sql new file mode 100644 index 000000000000..202e518e876c --- /dev/null +++ b/Firebird.5.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/Firebird.5/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5).sql b/Firebird.5/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5).sql new file mode 100644 index 000000000000..202e518e876c --- /dev/null +++ b/Firebird.5/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Firebird.5).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + From bf6c1dd5cbf1a2c05563a0d8c170bc5926c777f4 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 19:54:07 +0000 Subject: [PATCH 16/30] [Linux / Informix 14.10] baselines --- ...s.DistinctBy(Informix.DB2.LinqService).sql | 42 +++++++++++++++++++ ...stinctByTests.DistinctBy(Informix.DB2).sql | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 Informix.DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2.LinqService).sql create mode 100644 Informix.DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2).sql diff --git a/Informix.DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2.LinqService).sql b/Informix.DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2.LinqService).sql new file mode 100644 index 000000000000..650959a2e964 --- /dev/null +++ b/Informix.DB2.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Informix.DB2 Informix + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e."Date" DESC) as RowNumber, + e.Name, + e."Date" as Date_1, + e.Id, + e."Group" as Group_1, + e.Amount, + e.IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = 1 +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- Informix.DB2 Informix + +SELECT + t1.Id, + t1.Name, + t1."Group", + t1."Date", + t1.Amount, + t1.IsActive +FROM + TestData t1 + diff --git a/Informix.DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2).sql b/Informix.DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2).sql new file mode 100644 index 000000000000..650959a2e964 --- /dev/null +++ b/Informix.DB2/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Informix.DB2).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Informix.DB2 Informix + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e."Date" DESC) as RowNumber, + e.Name, + e."Date" as Date_1, + e.Id, + e."Group" as Group_1, + e.Amount, + e.IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = 1 +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- Informix.DB2 Informix + +SELECT + t1.Id, + t1.Name, + t1."Group", + t1."Date", + t1.Amount, + t1.IsActive +FROM + TestData t1 + From 808f5fd0650b7b9be237201e59f3921272022204 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:01:53 +0000 Subject: [PATCH 17/30] [Linux / MariaDB 11] baselines --- ...sts.DistinctBy(MariaDB.11.LinqService).sql | 42 +++++++++++++++++++ ...DistinctByTests.DistinctBy(MariaDB.11).sql | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 MariaDB.11.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11.LinqService).sql create mode 100644 MariaDB.11/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11).sql diff --git a/MariaDB.11.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11.LinqService).sql b/MariaDB.11.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11.LinqService).sql new file mode 100644 index 000000000000..c21bd68c1a5e --- /dev/null +++ b/MariaDB.11.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MariaDB.11/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11).sql b/MariaDB.11/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11).sql new file mode 100644 index 000000000000..c21bd68c1a5e --- /dev/null +++ b/MariaDB.11/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MariaDB.11).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + From 3d77065fd123f7c4df75b08227d2c530f5f6d8c6 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:06:21 +0000 Subject: [PATCH 18/30] [Windows / SQL Server 2017] baselines --- ...DistinctBy(SqlServer.2017.LinqService).sql | 42 +++++++++++++++++++ ...eOverloads(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...ngeNoValue(SqlServer.2017.LinqService).sql | 11 +++++ ....FrameRows(SqlServer.2017.LinqService).sql | 13 ++++++ ...xOverloads(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...nOverloads(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...entileCont(SqlServer.2017.LinqService).sql | 10 +++++ ...leSubquery(SqlServer.2017.LinqService).sql | 17 ++++++++ ...Partitions(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2017.LinqService).sql | 34 +++++++++++++++ ...mOverloads(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2017.LinqService).sql | 21 ++++++++++ ...tinctBy(SqlServer.2017.MS.LinqService).sql | 42 +++++++++++++++++++ ...erloads(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...NoValue(SqlServer.2017.MS.LinqService).sql | 11 +++++ ...ameRows(SqlServer.2017.MS.LinqService).sql | 13 ++++++ ...erloads(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...erloads(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...ileCont(SqlServer.2017.MS.LinqService).sql | 10 +++++ ...ubquery(SqlServer.2017.MS.LinqService).sql | 17 ++++++++ ...titions(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2017.MS.LinqService).sql | 34 +++++++++++++++ ...erloads(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2017.MS.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(SqlServer.2017.MS).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(SqlServer.2017.MS).sql | 21 ++++++++++ ...eOverloadsViaWindow(SqlServer.2017.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...istWithoutPartition(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...s.FrameRangeNoValue(SqlServer.2017.MS).sql | 11 +++++ ...ionsTests.FrameRows(SqlServer.2017.MS).sql | 13 ++++++ ...sTests.MaxOverloads(SqlServer.2017.MS).sql | 21 ++++++++++ ...xOverloadsViaWindow(SqlServer.2017.MS).sql | 21 ++++++++++ ...sTests.MinOverloads(SqlServer.2017.MS).sql | 21 ++++++++++ ...nOverloadsViaWindow(SqlServer.2017.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...ileWithoutPartition(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...ests.PercentileCont(SqlServer.2017.MS).sql | 20 +++++++++ ....PercentileSubquery(SqlServer.2017.MS).sql | 17 ++++++++ ...hMultiplePartitions(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...berWithoutPartition(SqlServer.2017.MS).sql | 34 +++++++++++++++ ...sTests.SumOverloads(SqlServer.2017.MS).sql | 21 ++++++++++ ...mOverloadsViaWindow(SqlServer.2017.MS).sql | 21 ++++++++++ ...inctByTests.DistinctBy(SqlServer.2017).sql | 42 +++++++++++++++++++ ...Tests.AverageOverloads(SqlServer.2017).sql | 21 ++++++++++ ...rageOverloadsViaWindow(SqlServer.2017).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2017).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2017).sql | 34 +++++++++++++++ ...meDistWithoutPartition(SqlServer.2017).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2017).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2017).sql | 34 +++++++++++++++ ...seRankWithoutPartition(SqlServer.2017).sql | 34 +++++++++++++++ ...ests.FrameRangeNoValue(SqlServer.2017).sql | 11 +++++ ...nctionsTests.FrameRows(SqlServer.2017).sql | 13 ++++++ ...ionsTests.MaxOverloads(SqlServer.2017).sql | 21 ++++++++++ ....MaxOverloadsViaWindow(SqlServer.2017).sql | 21 ++++++++++ ...ionsTests.MinOverloads(SqlServer.2017).sql | 21 ++++++++++ ....MinOverloadsViaWindow(SqlServer.2017).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2017).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2017).sql | 34 +++++++++++++++ ....NTileWithoutPartition(SqlServer.2017).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2017).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2017).sql | 34 +++++++++++++++ ...ntRankWithoutPartition(SqlServer.2017).sql | 34 +++++++++++++++ ...nsTests.PercentileCont(SqlServer.2017).sql | 20 +++++++++ ...sts.PercentileSubquery(SqlServer.2017).sql | 17 ++++++++ ...WithMultiplePartitions(SqlServer.2017).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2017).sql | 34 +++++++++++++++ ...s.RankWithoutPartition(SqlServer.2017).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2017).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2017).sql | 34 +++++++++++++++ ...NumberWithoutPartition(SqlServer.2017).sql | 34 +++++++++++++++ ...ionsTests.SumOverloads(SqlServer.2017).sql | 21 ++++++++++ ....SumOverloadsViaWindow(SqlServer.2017).sql | 21 ++++++++++ 124 files changed, 3512 insertions(+) create mode 100644 SqlServer.2017.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS).sql create mode 100644 SqlServer.2017/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017).sql create mode 100644 SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017).sql diff --git a/SqlServer.2017.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..4739bc86201b --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..239809fe9cde --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..239809fe9cde --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..0448f214b9af --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..2c9d613e874b --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..0f52a3a8a48d --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..9371bb1f07d0 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..280c285c83d0 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..15253062c4d1 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..fa1fbfd45b8a --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..c36ccf5a33fe --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..ffe242c19995 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..ffe242c19995 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..410db213bf4c --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..410db213bf4c --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..9a5a9357eec2 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..a1e1f628011d --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..0221f604e4de --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..17825c76eadf --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..1dec54309fb8 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..e878bd92474e --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..8c469900c89d --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2017 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..b0bda71153ce --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..f471d547c634 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..1f4d9be66a79 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..139264178412 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..d1477c41248d --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..0abb1de2d14c --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..319f72f1ee85 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..aee7166c00cb --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..aee7166c00cb --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..83d0e5eb7a02 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..719226a2d67c --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..719226a2d67c --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..4c4f00d51be9 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..f07e39733787 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..bccadd7685f3 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..ad0d985491a7 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..506acd358e70 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..aaa8489e9030 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..ae19ab1e8746 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..8b22f2a2af3e --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..5115d2ddb6cb --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..5115d2ddb6cb --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..bb7f6dfdc9a2 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..bb7f6dfdc9a2 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..f1dd794550c1 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..378765aa4b41 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..2c9fd42b7fa4 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..d662dc62bbeb --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..ca749055ac55 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..ae827de8fbe1 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..321ab4365ced --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..5b27e9dae75f --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..1de2ca6464d9 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..447668e018f7 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..3e4be4130d7a --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..e5093d584a44 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..6b60b5544f27 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..ba342635238b --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..dbae210014e0 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..dbae210014e0 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..83d0e5eb7a02 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..719226a2d67c --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..719226a2d67c --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..4c4f00d51be9 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..f07e39733787 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..bccadd7685f3 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..ad0d985491a7 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..506acd358e70 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..aaa8489e9030 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..ae19ab1e8746 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..8b22f2a2af3e --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..5115d2ddb6cb --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..5115d2ddb6cb --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..bb7f6dfdc9a2 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..bb7f6dfdc9a2 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..f1dd794550c1 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..378765aa4b41 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..2c9fd42b7fa4 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..d662dc62bbeb --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..ca749055ac55 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..ae827de8fbe1 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..7891c93dfe70 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..5b27e9dae75f --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..1de2ca6464d9 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..447668e018f7 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..3e4be4130d7a --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..e5093d584a44 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..6b60b5544f27 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..ba342635238b --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..dbae210014e0 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..dbae210014e0 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017).sql new file mode 100644 index 000000000000..4739bc86201b --- /dev/null +++ b/SqlServer.2017/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017).sql new file mode 100644 index 000000000000..239809fe9cde --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..239809fe9cde --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017).sql new file mode 100644 index 000000000000..0448f214b9af --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..2c9d613e874b --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017).sql new file mode 100644 index 000000000000..0f52a3a8a48d --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017).sql new file mode 100644 index 000000000000..9371bb1f07d0 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..280c285c83d0 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017).sql new file mode 100644 index 000000000000..15253062c4d1 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017).sql new file mode 100644 index 000000000000..fa1fbfd45b8a --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2017).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017).sql new file mode 100644 index 000000000000..c36ccf5a33fe --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2017).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017).sql new file mode 100644 index 000000000000..ffe242c19995 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..ffe242c19995 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017).sql new file mode 100644 index 000000000000..410db213bf4c --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..410db213bf4c --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017).sql new file mode 100644 index 000000000000..9a5a9357eec2 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..a1e1f628011d --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017).sql new file mode 100644 index 000000000000..0221f604e4de --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017).sql new file mode 100644 index 000000000000..17825c76eadf --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..1dec54309fb8 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017).sql new file mode 100644 index 000000000000..e878bd92474e --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017).sql new file mode 100644 index 000000000000..f3754bbeee81 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2017).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2017 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2017 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017).sql new file mode 100644 index 000000000000..b0bda71153ce --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2017).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017).sql new file mode 100644 index 000000000000..f471d547c634 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..1f4d9be66a79 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017).sql new file mode 100644 index 000000000000..139264178412 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017).sql new file mode 100644 index 000000000000..d1477c41248d --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..0abb1de2d14c --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017).sql new file mode 100644 index 000000000000..319f72f1ee85 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017).sql new file mode 100644 index 000000000000..aee7166c00cb --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017).sql new file mode 100644 index 000000000000..aee7166c00cb --- /dev/null +++ b/SqlServer.2017/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2017).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + From 124887fae3ff05309ae3256c44b8c87815d8e86f Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:08:39 +0000 Subject: [PATCH 19/30] [Linux / MySQL 9 (both providers)] baselines --- ...ests.DistinctBy(MySql.8.0.LinqService).sql | 42 +++++++++++++++++++ ....DistinctByTests.DistinctBy(MySql.8.0).sql | 42 +++++++++++++++++++ ...inctBy(MySqlConnector.8.0.LinqService).sql | 42 +++++++++++++++++++ ...ByTests.DistinctBy(MySqlConnector.8.0).sql | 42 +++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 MySql.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0.LinqService).sql create mode 100644 MySql.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0).sql create mode 100644 MySqlConnector.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0.LinqService).sql create mode 100644 MySqlConnector.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0).sql diff --git a/MySql.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..a39e92556556 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MySql.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0).sql b/MySql.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0).sql new file mode 100644 index 000000000000..a39e92556556 --- /dev/null +++ b/MySql.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..2a1fa6e540e7 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..2a1fa6e540e7 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + From 399262cf07764ab0e072332d20d08deba5992674 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:19:21 +0000 Subject: [PATCH 20/30] [Windows / SQL Server 2019] baselines --- ...DistinctBy(SqlServer.2019.LinqService).sql | 42 +++++++++++++++++++ ...eOverloads(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...ngeNoValue(SqlServer.2019.LinqService).sql | 11 +++++ ....FrameRows(SqlServer.2019.LinqService).sql | 13 ++++++ ...xOverloads(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...nOverloads(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...entileCont(SqlServer.2019.LinqService).sql | 10 +++++ ...leSubquery(SqlServer.2019.LinqService).sql | 17 ++++++++ ...Partitions(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2019.LinqService).sql | 34 +++++++++++++++ ...mOverloads(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2019.LinqService).sql | 21 ++++++++++ ...tinctBy(SqlServer.2019.MS.LinqService).sql | 42 +++++++++++++++++++ ...erloads(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...NoValue(SqlServer.2019.MS.LinqService).sql | 11 +++++ ...ameRows(SqlServer.2019.MS.LinqService).sql | 13 ++++++ ...erloads(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...erloads(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...ileCont(SqlServer.2019.MS.LinqService).sql | 10 +++++ ...ubquery(SqlServer.2019.MS.LinqService).sql | 17 ++++++++ ...titions(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2019.MS.LinqService).sql | 34 +++++++++++++++ ...erloads(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2019.MS.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(SqlServer.2019.MS).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(SqlServer.2019.MS).sql | 21 ++++++++++ ...eOverloadsViaWindow(SqlServer.2019.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...istWithoutPartition(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...s.FrameRangeNoValue(SqlServer.2019.MS).sql | 11 +++++ ...ionsTests.FrameRows(SqlServer.2019.MS).sql | 13 ++++++ ...sTests.MaxOverloads(SqlServer.2019.MS).sql | 21 ++++++++++ ...xOverloadsViaWindow(SqlServer.2019.MS).sql | 21 ++++++++++ ...sTests.MinOverloads(SqlServer.2019.MS).sql | 21 ++++++++++ ...nOverloadsViaWindow(SqlServer.2019.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...ileWithoutPartition(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...ests.PercentileCont(SqlServer.2019.MS).sql | 20 +++++++++ ....PercentileSubquery(SqlServer.2019.MS).sql | 17 ++++++++ ...hMultiplePartitions(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...berWithoutPartition(SqlServer.2019.MS).sql | 34 +++++++++++++++ ...sTests.SumOverloads(SqlServer.2019.MS).sql | 21 ++++++++++ ...mOverloadsViaWindow(SqlServer.2019.MS).sql | 21 ++++++++++ ...inctByTests.DistinctBy(SqlServer.2019).sql | 42 +++++++++++++++++++ ...Tests.AverageOverloads(SqlServer.2019).sql | 21 ++++++++++ ...rageOverloadsViaWindow(SqlServer.2019).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2019).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2019).sql | 34 +++++++++++++++ ...meDistWithoutPartition(SqlServer.2019).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2019).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2019).sql | 34 +++++++++++++++ ...seRankWithoutPartition(SqlServer.2019).sql | 34 +++++++++++++++ ...ests.FrameRangeNoValue(SqlServer.2019).sql | 11 +++++ ...nctionsTests.FrameRows(SqlServer.2019).sql | 13 ++++++ ...ionsTests.MaxOverloads(SqlServer.2019).sql | 21 ++++++++++ ....MaxOverloadsViaWindow(SqlServer.2019).sql | 21 ++++++++++ ...ionsTests.MinOverloads(SqlServer.2019).sql | 21 ++++++++++ ....MinOverloadsViaWindow(SqlServer.2019).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2019).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2019).sql | 34 +++++++++++++++ ....NTileWithoutPartition(SqlServer.2019).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2019).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2019).sql | 34 +++++++++++++++ ...ntRankWithoutPartition(SqlServer.2019).sql | 34 +++++++++++++++ ...nsTests.PercentileCont(SqlServer.2019).sql | 20 +++++++++ ...sts.PercentileSubquery(SqlServer.2019).sql | 17 ++++++++ ...WithMultiplePartitions(SqlServer.2019).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2019).sql | 34 +++++++++++++++ ...s.RankWithoutPartition(SqlServer.2019).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2019).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2019).sql | 34 +++++++++++++++ ...NumberWithoutPartition(SqlServer.2019).sql | 34 +++++++++++++++ ...ionsTests.SumOverloads(SqlServer.2019).sql | 21 ++++++++++ ....SumOverloadsViaWindow(SqlServer.2019).sql | 21 ++++++++++ 124 files changed, 3512 insertions(+) create mode 100644 SqlServer.2019.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS).sql create mode 100644 SqlServer.2019/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019).sql create mode 100644 SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019).sql diff --git a/SqlServer.2019.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..866f792043c8 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..bb9e891a30ae --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..bb9e891a30ae --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..9faf251047ce --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..c71fe25651fa --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..1141492d6217 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..c2f3fc15bad6 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..44d450ccdc87 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..acc41c814f2a --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..f0b3df1e13bf --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..4c112912aac5 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..0cf290599f78 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..0cf290599f78 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..2b961716ac7a --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..2b961716ac7a --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..f22dc8354349 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..fa8bb2a6fd69 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..ec3ec2415072 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..f5ab0d4f5686 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..1d2227699120 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..f6c06d2cf2e5 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..adbbb7419bcd --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..8c72263138d9 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..3254fc0e8b7d --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..180673627bbe --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..3b66c7287815 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..0269eb4f1253 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..27a16830c0a4 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..bd6dfe94540f --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..d55cb75491b2 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..d55cb75491b2 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..ac82709445e7 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..9fe2a2152687 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..9fe2a2152687 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..844c96d96253 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..fb98f6d8cdfa --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..97628483dc1d --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..078e63c2ed29 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..0b5ab27a387a --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..23c54b7a2284 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..d2d41f50aff9 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..4f78b380d858 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..b759851151fd --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..b759851151fd --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..e4cbf553b220 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..e4cbf553b220 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..9fe9a80e09bf --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..0e0bbd52cdf4 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..fda151557ac3 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..2d99cef4143f --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..c836af51771f --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..c4640821fbea --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..e9f12f44552a --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..f87decaf5ff4 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..c0b69e53dc1b --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..6c364fa0ca52 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..fc98e91fa4e5 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..c6344079e746 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..1f127da5255f --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..23eab55b2b8f --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..8b190910b3ae --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..8b190910b3ae --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..ac82709445e7 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..9fe2a2152687 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..9fe2a2152687 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..844c96d96253 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..fb98f6d8cdfa --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..97628483dc1d --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..078e63c2ed29 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..0b5ab27a387a --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..23c54b7a2284 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..d2d41f50aff9 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..4f78b380d858 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..b759851151fd --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..b759851151fd --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..e4cbf553b220 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..e4cbf553b220 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..9fe9a80e09bf --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..0e0bbd52cdf4 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..fda151557ac3 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..2d99cef4143f --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..c836af51771f --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..c4640821fbea --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..cfc251dea7e8 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..f87decaf5ff4 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..c0b69e53dc1b --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..6c364fa0ca52 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..fc98e91fa4e5 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..c6344079e746 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..1f127da5255f --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..23eab55b2b8f --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..8b190910b3ae --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..8b190910b3ae --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019).sql new file mode 100644 index 000000000000..866f792043c8 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019).sql new file mode 100644 index 000000000000..bb9e891a30ae --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..bb9e891a30ae --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019).sql new file mode 100644 index 000000000000..9faf251047ce --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..c71fe25651fa --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019).sql new file mode 100644 index 000000000000..1141492d6217 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019).sql new file mode 100644 index 000000000000..c2f3fc15bad6 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..44d450ccdc87 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019).sql new file mode 100644 index 000000000000..acc41c814f2a --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019).sql new file mode 100644 index 000000000000..f0b3df1e13bf --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2019).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019).sql new file mode 100644 index 000000000000..4c112912aac5 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2019).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019).sql new file mode 100644 index 000000000000..0cf290599f78 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..0cf290599f78 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019).sql new file mode 100644 index 000000000000..2b961716ac7a --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..2b961716ac7a --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019).sql new file mode 100644 index 000000000000..f22dc8354349 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..fa8bb2a6fd69 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019).sql new file mode 100644 index 000000000000..ec3ec2415072 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019).sql new file mode 100644 index 000000000000..f5ab0d4f5686 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..1d2227699120 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019).sql new file mode 100644 index 000000000000..f6c06d2cf2e5 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019).sql new file mode 100644 index 000000000000..cf01b2e95440 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2019).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2019 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019).sql new file mode 100644 index 000000000000..8c72263138d9 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2019).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019).sql new file mode 100644 index 000000000000..3254fc0e8b7d --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..180673627bbe --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019).sql new file mode 100644 index 000000000000..3b66c7287815 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019).sql new file mode 100644 index 000000000000..0269eb4f1253 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..27a16830c0a4 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019).sql new file mode 100644 index 000000000000..bd6dfe94540f --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019).sql new file mode 100644 index 000000000000..d55cb75491b2 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019).sql new file mode 100644 index 000000000000..d55cb75491b2 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2019).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + From e19383a5460eaecdbb0ce68d36bcfbbb5cfda0ae Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:22:07 +0000 Subject: [PATCH 21/30] [Windows / SQL Server 2022] baselines --- ...DistinctBy(SqlServer.2022.LinqService).sql | 42 +++++++++++++++++++ ...eOverloads(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...ngeNoValue(SqlServer.2022.LinqService).sql | 11 +++++ ....FrameRows(SqlServer.2022.LinqService).sql | 13 ++++++ ...xOverloads(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...nOverloads(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...Partitions(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...entileCont(SqlServer.2022.LinqService).sql | 10 +++++ ...leSubquery(SqlServer.2022.LinqService).sql | 17 ++++++++ ...Partitions(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...Partitions(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...fineWindow(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...tPartition(SqlServer.2022.LinqService).sql | 34 +++++++++++++++ ...mOverloads(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...sViaWindow(SqlServer.2022.LinqService).sql | 21 ++++++++++ ...tinctBy(SqlServer.2022.MS.LinqService).sql | 42 +++++++++++++++++++ ...erloads(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...NoValue(SqlServer.2022.MS.LinqService).sql | 11 +++++ ...ameRows(SqlServer.2022.MS.LinqService).sql | 13 ++++++ ...erloads(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...erloads(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...titions(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...ileCont(SqlServer.2022.MS.LinqService).sql | 10 +++++ ...ubquery(SqlServer.2022.MS.LinqService).sql | 17 ++++++++ ...titions(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...titions(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...eWindow(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...rtition(SqlServer.2022.MS.LinqService).sql | 34 +++++++++++++++ ...erloads(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...aWindow(SqlServer.2022.MS.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(SqlServer.2022.MS).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(SqlServer.2022.MS).sql | 21 ++++++++++ ...eOverloadsViaWindow(SqlServer.2022.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...istWithoutPartition(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...s.FrameRangeNoValue(SqlServer.2022.MS).sql | 11 +++++ ...ionsTests.FrameRows(SqlServer.2022.MS).sql | 13 ++++++ ...sTests.MaxOverloads(SqlServer.2022.MS).sql | 21 ++++++++++ ...xOverloadsViaWindow(SqlServer.2022.MS).sql | 21 ++++++++++ ...sTests.MinOverloads(SqlServer.2022.MS).sql | 21 ++++++++++ ...nOverloadsViaWindow(SqlServer.2022.MS).sql | 21 ++++++++++ ...hMultiplePartitions(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...ileWithoutPartition(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...ests.PercentileCont(SqlServer.2022.MS).sql | 20 +++++++++ ....PercentileSubquery(SqlServer.2022.MS).sql | 17 ++++++++ ...hMultiplePartitions(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...ankWithoutPartition(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...hMultiplePartitions(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...onsWithDefineWindow(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...berWithoutPartition(SqlServer.2022.MS).sql | 34 +++++++++++++++ ...sTests.SumOverloads(SqlServer.2022.MS).sql | 21 ++++++++++ ...mOverloadsViaWindow(SqlServer.2022.MS).sql | 21 ++++++++++ ...inctByTests.DistinctBy(SqlServer.2022).sql | 42 +++++++++++++++++++ ...Tests.AverageOverloads(SqlServer.2022).sql | 21 ++++++++++ ...rageOverloadsViaWindow(SqlServer.2022).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2022).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2022).sql | 34 +++++++++++++++ ...meDistWithoutPartition(SqlServer.2022).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2022).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2022).sql | 34 +++++++++++++++ ...seRankWithoutPartition(SqlServer.2022).sql | 34 +++++++++++++++ ...ests.FrameRangeNoValue(SqlServer.2022).sql | 11 +++++ ...nctionsTests.FrameRows(SqlServer.2022).sql | 13 ++++++ ...ionsTests.MaxOverloads(SqlServer.2022).sql | 21 ++++++++++ ....MaxOverloadsViaWindow(SqlServer.2022).sql | 21 ++++++++++ ...ionsTests.MinOverloads(SqlServer.2022).sql | 21 ++++++++++ ....MinOverloadsViaWindow(SqlServer.2022).sql | 21 ++++++++++ ...WithMultiplePartitions(SqlServer.2022).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2022).sql | 34 +++++++++++++++ ....NTileWithoutPartition(SqlServer.2022).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2022).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2022).sql | 34 +++++++++++++++ ...ntRankWithoutPartition(SqlServer.2022).sql | 34 +++++++++++++++ ...nsTests.PercentileCont(SqlServer.2022).sql | 20 +++++++++ ...sts.PercentileSubquery(SqlServer.2022).sql | 17 ++++++++ ...WithMultiplePartitions(SqlServer.2022).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2022).sql | 34 +++++++++++++++ ...s.RankWithoutPartition(SqlServer.2022).sql | 34 +++++++++++++++ ...WithMultiplePartitions(SqlServer.2022).sql | 34 +++++++++++++++ ...itionsWithDefineWindow(SqlServer.2022).sql | 34 +++++++++++++++ ...NumberWithoutPartition(SqlServer.2022).sql | 34 +++++++++++++++ ...ionsTests.SumOverloads(SqlServer.2022).sql | 21 ++++++++++ ....SumOverloadsViaWindow(SqlServer.2022).sql | 21 ++++++++++ 124 files changed, 3512 insertions(+) create mode 100644 SqlServer.2022.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS).sql create mode 100644 SqlServer.2022/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022).sql create mode 100644 SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022).sql diff --git a/SqlServer.2022.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..3651d0cb3fa6 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..dc7e2301c988 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..dc7e2301c988 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..1a299a5cad85 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..dee600cd4d16 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..5bd08e74e887 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..abf072b0eb5e --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..106690fd4941 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..57a46fb792a2 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..91d29cd6485e --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..62a9f9b8c526 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..c82f0091d0d0 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..c82f0091d0d0 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..c4bf72f5eaed --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..c4bf72f5eaed --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..8edf8e0c6f6c --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..fab34f2406e4 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..3b9fd03400cd --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..21cd87ae3a3f --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..1b7bc1ecc09e --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..a711228852e9 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..c92c06b64b27 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2022 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..c215c5487fe2 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..9ca3b8f30072 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..e8728bf688f3 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..089655bc9c83 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..62991379f5bd --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..cf1f23458392 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..b8a43ad87c3e --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..6c69a0b1c5fc --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..6c69a0b1c5fc --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..aa9c3594acd0 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..7487215714f6 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..7487215714f6 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..0f84bdb68008 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..6fe770d506eb --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..e2dbe36fecf8 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..a89f5b935348 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..512925e3c358 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..46da476ca0ca --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..86a6866d7337 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..96f9caa47d3b --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..5964c308dc23 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..5964c308dc23 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..e2a24ca085f7 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..e2a24ca085f7 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..68619351f4ce --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..198575052e06 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..e66a71480350 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..39c714cae04b --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..30cacbabe715 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..b4923081cd4c --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..47db97197601 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..378d51636b09 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..8963636a06f1 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..9f0d184f1989 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..fba090617205 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..8b39864d4682 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..d96f25bdfbb1 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..776bbe707a03 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..9324dd12457c --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..9324dd12457c --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..aa9c3594acd0 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..7487215714f6 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..7487215714f6 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..0f84bdb68008 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..6fe770d506eb --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..e2dbe36fecf8 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..a89f5b935348 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..512925e3c358 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..46da476ca0ca --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..86a6866d7337 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..96f9caa47d3b --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..5964c308dc23 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..5964c308dc23 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..e2a24ca085f7 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..e2a24ca085f7 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..68619351f4ce --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..198575052e06 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..e66a71480350 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..39c714cae04b --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..30cacbabe715 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..b4923081cd4c --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..2bb6d22c83b6 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..378d51636b09 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..8963636a06f1 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..9f0d184f1989 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..fba090617205 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..8b39864d4682 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..d96f25bdfbb1 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..776bbe707a03 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..9324dd12457c --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..9324dd12457c --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022).sql new file mode 100644 index 000000000000..3651d0cb3fa6 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022).sql new file mode 100644 index 000000000000..dc7e2301c988 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..dc7e2301c988 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022).sql new file mode 100644 index 000000000000..1a299a5cad85 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..dee600cd4d16 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022).sql new file mode 100644 index 000000000000..5bd08e74e887 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022).sql new file mode 100644 index 000000000000..abf072b0eb5e --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..106690fd4941 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022).sql new file mode 100644 index 000000000000..57a46fb792a2 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022).sql new file mode 100644 index 000000000000..91d29cd6485e --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.2022).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022).sql new file mode 100644 index 000000000000..62a9f9b8c526 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.2022).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022).sql new file mode 100644 index 000000000000..c82f0091d0d0 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..c82f0091d0d0 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022).sql new file mode 100644 index 000000000000..c4bf72f5eaed --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..c4bf72f5eaed --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022).sql new file mode 100644 index 000000000000..8edf8e0c6f6c --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..fab34f2406e4 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022).sql new file mode 100644 index 000000000000..3b9fd03400cd --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022).sql new file mode 100644 index 000000000000..21cd87ae3a3f --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..1b7bc1ecc09e --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022).sql new file mode 100644 index 000000000000..a711228852e9 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022).sql new file mode 100644 index 000000000000..c13f449efa44 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.2022).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.2022 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.2022 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022).sql new file mode 100644 index 000000000000..c215c5487fe2 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.2022).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022).sql new file mode 100644 index 000000000000..9ca3b8f30072 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..e8728bf688f3 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022).sql new file mode 100644 index 000000000000..089655bc9c83 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022).sql new file mode 100644 index 000000000000..62991379f5bd --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..cf1f23458392 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022).sql new file mode 100644 index 000000000000..b8a43ad87c3e --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022).sql new file mode 100644 index 000000000000..6c69a0b1c5fc --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022).sql new file mode 100644 index 000000000000..6c69a0b1c5fc --- /dev/null +++ b/SqlServer.2022/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.2022).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + From 93bf327bdb933a759d26f135425af8f9410d3124 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:28:03 +0000 Subject: [PATCH 22/30] [Linux / PostgreSQL 14] baselines --- ...ePartitions(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.14.LinqService).sql | 34 +++++++++++++++++++ ...tWithMultiplePartitions(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...umeDistWithoutPartition(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...nseRankWithoutPartition(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...entRankWithoutPartition(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.14).sql | 34 +++++++++++++++++++ ...ts.RankWithoutPartition(PostgreSQL.14).sql | 34 +++++++++++++++++++ 24 files changed, 816 insertions(+) create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14.LinqService).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql create mode 100644 PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14).sql diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..9806148ec104 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..7a42fab7bb44 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..5b22eeb1ccf8 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..0487a4c096f1 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..268416942bb5 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..e9241aad5545 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..caedc00d0c80 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..224229a9bfb0 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..d0a121d59279 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..b744098fbf89 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..903fd0dac6ef --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..a4ac890f80c3 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14).sql new file mode 100644 index 000000000000..9806148ec104 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..7a42fab7bb44 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14).sql new file mode 100644 index 000000000000..5b22eeb1ccf8 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14).sql new file mode 100644 index 000000000000..0487a4c096f1 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..268416942bb5 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14).sql new file mode 100644 index 000000000000..e9241aad5545 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14).sql new file mode 100644 index 000000000000..caedc00d0c80 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..224229a9bfb0 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14).sql new file mode 100644 index 000000000000..d0a121d59279 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14).sql new file mode 100644 index 000000000000..b744098fbf89 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql new file mode 100644 index 000000000000..903fd0dac6ef --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14).sql new file mode 100644 index 000000000000..a4ac890f80c3 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + From 440e3350edc7211d15aca4d196ff2c23a08d49f6 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 21:29:11 +0100 Subject: [PATCH 23/30] [Linux / Oracle 21c] baselines --- ...tinctBy(Oracle.21.Managed.LinqService).sql | 42 +++++++++++++++++++ ...erloads(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...titions(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.21.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...titions(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.21.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...eGroups(Oracle.21.Managed.LinqService).sql | 13 ++++++ ...NoValue(Oracle.21.Managed.LinqService).sql | 11 +++++ ...geValue(Oracle.21.Managed.LinqService).sql | 9 ++++ ...ameRows(Oracle.21.Managed.LinqService).sql | 13 ++++++ ...erloads(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...erloads(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...titions(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.21.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...titions(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.21.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...ileCont(Oracle.21.Managed.LinqService).sql | 10 +++++ ...rouping(Oracle.21.Managed.LinqService).sql | 14 +++++++ ...jection(Oracle.21.Managed.LinqService).sql | 26 ++++++++++++ ...ubquery(Oracle.21.Managed.LinqService).sql | 17 ++++++++ ...titions(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.21.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...titions(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.21.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.21.Managed.LinqService).sql | 34 +++++++++++++++ ...erloads(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.21.Managed.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(Oracle.21.Managed).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(Oracle.21.Managed).sql | 21 ++++++++++ ...eOverloadsViaWindow(Oracle.21.Managed).sql | 21 ++++++++++ ...hMultiplePartitions(Oracle.21.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.21.Managed).sql | 34 +++++++++++++++ ...s.CumeDistWithNulls(Oracle.21.Managed).sql | 30 +++++++++++++ ...istWithoutPartition(Oracle.21.Managed).sql | 34 +++++++++++++++ ...hMultiplePartitions(Oracle.21.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.21.Managed).sql | 34 +++++++++++++++ ....DenseRankWithNulls(Oracle.21.Managed).sql | 30 +++++++++++++ ...ankWithoutPartition(Oracle.21.Managed).sql | 34 +++++++++++++++ ...nsTests.FrameGroups(Oracle.21.Managed).sql | 13 ++++++ ...s.FrameRangeNoValue(Oracle.21.Managed).sql | 11 +++++ ...sts.FrameRangeValue(Oracle.21.Managed).sql | 9 ++++ ...ionsTests.FrameRows(Oracle.21.Managed).sql | 13 ++++++ ...sTests.MaxOverloads(Oracle.21.Managed).sql | 21 ++++++++++ ...xOverloadsViaWindow(Oracle.21.Managed).sql | 21 ++++++++++ ...sTests.MinOverloads(Oracle.21.Managed).sql | 21 ++++++++++ ...nOverloadsViaWindow(Oracle.21.Managed).sql | 21 ++++++++++ ...hMultiplePartitions(Oracle.21.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.21.Managed).sql | 34 +++++++++++++++ ...ests.NTileWithNulls(Oracle.21.Managed).sql | 30 +++++++++++++ ...ileWithoutPartition(Oracle.21.Managed).sql | 34 +++++++++++++++ ...hMultiplePartitions(Oracle.21.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.21.Managed).sql | 34 +++++++++++++++ ...ercentRankWithNulls(Oracle.21.Managed).sql | 30 +++++++++++++ ...ankWithoutPartition(Oracle.21.Managed).sql | 34 +++++++++++++++ ...ests.PercentileCont(Oracle.21.Managed).sql | 20 +++++++++ ...centileContGrouping(Oracle.21.Managed).sql | 14 +++++++ ...tGroupingProjection(Oracle.21.Managed).sql | 26 ++++++++++++ ....PercentileSubquery(Oracle.21.Managed).sql | 17 ++++++++ ...hMultiplePartitions(Oracle.21.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.21.Managed).sql | 34 +++++++++++++++ ...Tests.RankWithNulls(Oracle.21.Managed).sql | 30 +++++++++++++ ...ankWithoutPartition(Oracle.21.Managed).sql | 34 +++++++++++++++ ...hMultiplePartitions(Oracle.21.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.21.Managed).sql | 34 +++++++++++++++ ....RowNumberWithNulls(Oracle.21.Managed).sql | 30 +++++++++++++ ...berWithoutPartition(Oracle.21.Managed).sql | 34 +++++++++++++++ ...sTests.SumOverloads(Oracle.21.Managed).sql | 21 ++++++++++ ...mOverloadsViaWindow(Oracle.21.Managed).sql | 21 ++++++++++ 82 files changed, 2240 insertions(+) create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed.LinqService).sql create mode 100644 Oracle.21.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed).sql create mode 100644 Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed).sql diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..b0092a8d8a79 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..274b3d1accbd --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..274b3d1accbd --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..2faed6f69ed8 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..e2f81312260d --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..44783ca2c7e7 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..2e32160574e8 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..b296d511c966 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..7e20c9305325 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..98752b4d9236 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..f5750c97e53c --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..cafff4888d5d --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..7c7f96b8d9bd --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..221ef374bd6a --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..a51452a578db --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..47181da92fe3 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..47181da92fe3 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..8e419d09129a --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..8e419d09129a --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..ac3fd2888eb2 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..f54590bafef4 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..b24fa798eba4 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..a34038d46f6e --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..20acb5fa0af9 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..72de1bfddf86 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..1399d8d1d424 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..ca157c9fe0ba --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..9527be8d58a9 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 +DECLARE @argument BinaryDouble -- Double +SET @argument = 0.5D + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..0c5ae13f598c --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..c9cd268f263e --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + g_2."Key_1", + t1."c1", + g_2."c1" +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..4e0ba47a2677 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + t."CategoryId", + t1."c1" +FROM + "WindowFunctionTestEntity" t + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."DecimalValue") as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..048abb77e0d0 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..557d52b0302f --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..8367980957f8 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..b8ff3d67b9b5 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..cfa2d1e6a413 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..adaa7a074f93 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..68e268046bd0 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..2a3b256d1a7f --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..4b8c6107df78 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed.LinqService).sql b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed.LinqService).sql new file mode 100644 index 000000000000..4b8c6107df78 --- /dev/null +++ b/Oracle.21.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed).sql new file mode 100644 index 000000000000..b0092a8d8a79 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.21.Managed).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed).sql new file mode 100644 index 000000000000..274b3d1accbd --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..274b3d1accbd --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed).sql new file mode 100644 index 000000000000..2faed6f69ed8 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..e2f81312260d --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed).sql new file mode 100644 index 000000000000..44783ca2c7e7 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.21.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed).sql new file mode 100644 index 000000000000..2e32160574e8 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed).sql new file mode 100644 index 000000000000..b296d511c966 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..7e20c9305325 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed).sql new file mode 100644 index 000000000000..98752b4d9236 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.21.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed).sql new file mode 100644 index 000000000000..f5750c97e53c --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed).sql new file mode 100644 index 000000000000..cafff4888d5d --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.21.Managed).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed).sql new file mode 100644 index 000000000000..7c7f96b8d9bd --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.21.Managed).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed).sql new file mode 100644 index 000000000000..221ef374bd6a --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.21.Managed).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed).sql new file mode 100644 index 000000000000..a51452a578db --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.21.Managed).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed).sql new file mode 100644 index 000000000000..47181da92fe3 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..47181da92fe3 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed).sql new file mode 100644 index 000000000000..8e419d09129a --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..8e419d09129a --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed).sql new file mode 100644 index 000000000000..ac3fd2888eb2 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..f54590bafef4 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed).sql new file mode 100644 index 000000000000..b24fa798eba4 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.21.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed).sql new file mode 100644 index 000000000000..a34038d46f6e --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed).sql new file mode 100644 index 000000000000..20acb5fa0af9 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..72de1bfddf86 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed).sql new file mode 100644 index 000000000000..1399d8d1d424 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.21.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed).sql new file mode 100644 index 000000000000..ca157c9fe0ba --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed).sql new file mode 100644 index 000000000000..d7e3ffe8b15e --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.21.Managed).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 +DECLARE @argument BinaryDouble -- Double +SET @argument = 0.5D + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 (asynchronously) +DECLARE @argument BinaryDouble -- Double +SET @argument = 0.5D + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" t1 + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed).sql new file mode 100644 index 000000000000..0c5ae13f598c --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.21.Managed).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed).sql new file mode 100644 index 000000000000..c9cd268f263e --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.21.Managed).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + g_2."Key_1", + t1."c1", + g_2."c1" +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed).sql new file mode 100644 index 000000000000..4e0ba47a2677 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.21.Managed).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + t."CategoryId", + t1."c1" +FROM + "WindowFunctionTestEntity" t + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."DecimalValue") as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed).sql new file mode 100644 index 000000000000..048abb77e0d0 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..557d52b0302f --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed).sql new file mode 100644 index 000000000000..8367980957f8 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.21.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed).sql new file mode 100644 index 000000000000..b8ff3d67b9b5 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed).sql new file mode 100644 index 000000000000..cfa2d1e6a413 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..adaa7a074f93 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed).sql new file mode 100644 index 000000000000..68e268046bd0 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.21.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed).sql new file mode 100644 index 000000000000..2a3b256d1a7f --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.21.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed).sql new file mode 100644 index 000000000000..4b8c6107df78 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed).sql new file mode 100644 index 000000000000..4b8c6107df78 --- /dev/null +++ b/Oracle.21.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.21.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + From 1743f4cee875ddf677b055c1c6e670f183806b7f Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:29:38 +0000 Subject: [PATCH 24/30] [Linux / PostgreSQL 15] baselines --- ...ePartitions(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.15.LinqService).sql | 34 +++++++++++++++++++ ...tWithMultiplePartitions(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...umeDistWithoutPartition(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...nseRankWithoutPartition(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...entRankWithoutPartition(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.15).sql | 34 +++++++++++++++++++ ...ts.RankWithoutPartition(PostgreSQL.15).sql | 34 +++++++++++++++++++ 24 files changed, 816 insertions(+) create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15.LinqService).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql create mode 100644 PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15).sql diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..2075259546f1 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..a7e5616f1a6c --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..adda7857ff58 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..dea76ed9c0ab --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..aafd8909a34f --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..f2347c3b7efa --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..3041a29f78ca --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..d6fc4270b8ca --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..8db4b604bed7 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..32fe7572846b --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..cda410117245 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..22f6c965c939 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15).sql new file mode 100644 index 000000000000..2075259546f1 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..a7e5616f1a6c --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15).sql new file mode 100644 index 000000000000..adda7857ff58 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15).sql new file mode 100644 index 000000000000..dea76ed9c0ab --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..aafd8909a34f --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15).sql new file mode 100644 index 000000000000..f2347c3b7efa --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15).sql new file mode 100644 index 000000000000..3041a29f78ca --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..d6fc4270b8ca --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15).sql new file mode 100644 index 000000000000..8db4b604bed7 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15).sql new file mode 100644 index 000000000000..32fe7572846b --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql new file mode 100644 index 000000000000..cda410117245 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15).sql new file mode 100644 index 000000000000..22f6c965c939 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + From d19f55acb3a596542784d77c29831246c432e398 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:30:15 +0000 Subject: [PATCH 25/30] [Linux / PostgreSQL 13] baselines --- ...ePartitions(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.13.LinqService).sql | 34 +++++++++++++++++++ ...tWithMultiplePartitions(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...umeDistWithoutPartition(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...nseRankWithoutPartition(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...entRankWithoutPartition(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.13).sql | 34 +++++++++++++++++++ ...ts.RankWithoutPartition(PostgreSQL.13).sql | 34 +++++++++++++++++++ 24 files changed, 816 insertions(+) create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13.LinqService).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql create mode 100644 PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13).sql diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..1ea949321d5d --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..4906743c47f7 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..6c240ac2ef5d --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..1a88a566f1f0 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..636c78d492bb --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..86b78dd7ad90 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..d4e9aa8e8d83 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..5c739cce274a --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..6b417f4b2c66 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..a60e6d25dd92 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..faf6c2f30d30 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..f9d002cbf4d6 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13).sql new file mode 100644 index 000000000000..1ea949321d5d --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..4906743c47f7 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13).sql new file mode 100644 index 000000000000..6c240ac2ef5d --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13).sql new file mode 100644 index 000000000000..1a88a566f1f0 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..636c78d492bb --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13).sql new file mode 100644 index 000000000000..86b78dd7ad90 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13).sql new file mode 100644 index 000000000000..d4e9aa8e8d83 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..5c739cce274a --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13).sql new file mode 100644 index 000000000000..6b417f4b2c66 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13).sql new file mode 100644 index 000000000000..a60e6d25dd92 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql new file mode 100644 index 000000000000..faf6c2f30d30 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13).sql new file mode 100644 index 000000000000..f9d002cbf4d6 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + From cbb979a7558d497ada16ae578e2aaaba168dca4d Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:36:56 +0000 Subject: [PATCH 26/30] [Linux / PostgreSQL 17] baselines --- ...ePartitions(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.17.LinqService).sql | 34 +++++++++++++++++++ ...tWithMultiplePartitions(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...umeDistWithoutPartition(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...nseRankWithoutPartition(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...entRankWithoutPartition(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.17).sql | 34 +++++++++++++++++++ ...ts.RankWithoutPartition(PostgreSQL.17).sql | 34 +++++++++++++++++++ 24 files changed, 816 insertions(+) create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17.LinqService).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql create mode 100644 PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17).sql diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..96af8aac96db --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..35b4771048f7 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..e67fb3c951a4 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..1e2a11d7aa14 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..7fb2a5911936 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..765e741c0322 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..5e403ea7fbf6 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..4b1df8b54131 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..bc59d5d7d037 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..d0b591195fb1 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..3104749b082a --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..b26547794a34 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17).sql new file mode 100644 index 000000000000..96af8aac96db --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..35b4771048f7 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17).sql new file mode 100644 index 000000000000..e67fb3c951a4 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17).sql new file mode 100644 index 000000000000..1e2a11d7aa14 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..7fb2a5911936 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17).sql new file mode 100644 index 000000000000..765e741c0322 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17).sql new file mode 100644 index 000000000000..5e403ea7fbf6 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..4b1df8b54131 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17).sql new file mode 100644 index 000000000000..bc59d5d7d037 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17).sql new file mode 100644 index 000000000000..d0b591195fb1 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql new file mode 100644 index 000000000000..3104749b082a --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17).sql new file mode 100644 index 000000000000..b26547794a34 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + From 943ecf3da38090f391228cd0329ac1be1cdf49b6 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:37:50 +0000 Subject: [PATCH 27/30] [Linux / PostgreSQL 16] baselines --- ...ePartitions(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...ePartitions(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...efineWindow(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...utPartition(PostgreSQL.16.LinqService).sql | 34 +++++++++++++++++++ ...tWithMultiplePartitions(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...umeDistWithoutPartition(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...nseRankWithoutPartition(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...entRankWithoutPartition(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...kWithMultiplePartitions(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...titionsWithDefineWindow(PostgreSQL.16).sql | 34 +++++++++++++++++++ ...ts.RankWithoutPartition(PostgreSQL.16).sql | 34 +++++++++++++++++++ 24 files changed, 816 insertions(+) create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16.LinqService).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql create mode 100644 PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16).sql diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..7c8ce1ece42b --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..b11b619e9508 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..78c853a3ba67 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..f354d3cf7d1e --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..96a9201faeab --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..f576effdc88f --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..d5fec6eacd34 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..ba9a10664735 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..a2613e0ce16a --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..8a2365f3da95 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..ed289db09930 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..0eb5f346517f --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16).sql new file mode 100644 index 000000000000..7c8ce1ece42b --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..b11b619e9508 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16).sql new file mode 100644 index 000000000000..78c853a3ba67 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16).sql new file mode 100644 index 000000000000..f354d3cf7d1e --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..96a9201faeab --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16).sql new file mode 100644 index 000000000000..f576effdc88f --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16).sql new file mode 100644 index 000000000000..d5fec6eacd34 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..ba9a10664735 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16).sql new file mode 100644 index 000000000000..a2613e0ce16a --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16).sql new file mode 100644 index 000000000000..8a2365f3da95 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql new file mode 100644 index 000000000000..ed289db09930 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16).sql new file mode 100644 index 000000000000..0eb5f346517f --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + From ac65ce5eea64cc107c4f25fe22964299a2185dd0 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 21:39:57 +0100 Subject: [PATCH 28/30] [Linux / Oracle 23c] baselines --- ...tinctBy(Oracle.23.Managed.LinqService).sql | 42 +++++++++++++++++++ ...erloads(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...titions(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.23.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...titions(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.23.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...eGroups(Oracle.23.Managed.LinqService).sql | 13 ++++++ ...NoValue(Oracle.23.Managed.LinqService).sql | 11 +++++ ...geValue(Oracle.23.Managed.LinqService).sql | 9 ++++ ...ameRows(Oracle.23.Managed.LinqService).sql | 13 ++++++ ...erloads(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...erloads(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...titions(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.23.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...titions(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.23.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...ileCont(Oracle.23.Managed.LinqService).sql | 10 +++++ ...rouping(Oracle.23.Managed.LinqService).sql | 14 +++++++ ...jection(Oracle.23.Managed.LinqService).sql | 26 ++++++++++++ ...ubquery(Oracle.23.Managed.LinqService).sql | 17 ++++++++ ...titions(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.23.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...titions(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...eWindow(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...thNulls(Oracle.23.Managed.LinqService).sql | 30 +++++++++++++ ...rtition(Oracle.23.Managed.LinqService).sql | 34 +++++++++++++++ ...erloads(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...aWindow(Oracle.23.Managed.LinqService).sql | 21 ++++++++++ ...tByTests.DistinctBy(Oracle.23.Managed).sql | 42 +++++++++++++++++++ ...ts.AverageOverloads(Oracle.23.Managed).sql | 21 ++++++++++ ...eOverloadsViaWindow(Oracle.23.Managed).sql | 21 ++++++++++ ...hMultiplePartitions(Oracle.23.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.23.Managed).sql | 34 +++++++++++++++ ...s.CumeDistWithNulls(Oracle.23.Managed).sql | 30 +++++++++++++ ...istWithoutPartition(Oracle.23.Managed).sql | 34 +++++++++++++++ ...hMultiplePartitions(Oracle.23.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.23.Managed).sql | 34 +++++++++++++++ ....DenseRankWithNulls(Oracle.23.Managed).sql | 30 +++++++++++++ ...ankWithoutPartition(Oracle.23.Managed).sql | 34 +++++++++++++++ ...nsTests.FrameGroups(Oracle.23.Managed).sql | 13 ++++++ ...s.FrameRangeNoValue(Oracle.23.Managed).sql | 11 +++++ ...sts.FrameRangeValue(Oracle.23.Managed).sql | 9 ++++ ...ionsTests.FrameRows(Oracle.23.Managed).sql | 13 ++++++ ...sTests.MaxOverloads(Oracle.23.Managed).sql | 21 ++++++++++ ...xOverloadsViaWindow(Oracle.23.Managed).sql | 21 ++++++++++ ...sTests.MinOverloads(Oracle.23.Managed).sql | 21 ++++++++++ ...nOverloadsViaWindow(Oracle.23.Managed).sql | 21 ++++++++++ ...hMultiplePartitions(Oracle.23.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.23.Managed).sql | 34 +++++++++++++++ ...ests.NTileWithNulls(Oracle.23.Managed).sql | 30 +++++++++++++ ...ileWithoutPartition(Oracle.23.Managed).sql | 34 +++++++++++++++ ...hMultiplePartitions(Oracle.23.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.23.Managed).sql | 34 +++++++++++++++ ...ercentRankWithNulls(Oracle.23.Managed).sql | 30 +++++++++++++ ...ankWithoutPartition(Oracle.23.Managed).sql | 34 +++++++++++++++ ...ests.PercentileCont(Oracle.23.Managed).sql | 20 +++++++++ ...centileContGrouping(Oracle.23.Managed).sql | 14 +++++++ ...tGroupingProjection(Oracle.23.Managed).sql | 26 ++++++++++++ ....PercentileSubquery(Oracle.23.Managed).sql | 17 ++++++++ ...hMultiplePartitions(Oracle.23.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.23.Managed).sql | 34 +++++++++++++++ ...Tests.RankWithNulls(Oracle.23.Managed).sql | 30 +++++++++++++ ...ankWithoutPartition(Oracle.23.Managed).sql | 34 +++++++++++++++ ...hMultiplePartitions(Oracle.23.Managed).sql | 34 +++++++++++++++ ...onsWithDefineWindow(Oracle.23.Managed).sql | 34 +++++++++++++++ ....RowNumberWithNulls(Oracle.23.Managed).sql | 30 +++++++++++++ ...berWithoutPartition(Oracle.23.Managed).sql | 34 +++++++++++++++ ...sTests.SumOverloads(Oracle.23.Managed).sql | 21 ++++++++++ ...mOverloadsViaWindow(Oracle.23.Managed).sql | 21 ++++++++++ 82 files changed, 2240 insertions(+) create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed.LinqService).sql create mode 100644 Oracle.23.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed).sql create mode 100644 Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed).sql diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..ef58b582272f --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..d2b40b5646d3 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..d2b40b5646d3 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..23b4961cb225 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..2d96d11fdd09 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..aef7a178a614 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..d43307d0d618 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..9bf8005cf150 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..f146dcd238fe --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..8a74a251dedd --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..ee7fe2c8c04b --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..e32ffc40ac39 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..6d8206799b72 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..3caa3fb578ac --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..ff9b508ab6a7 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..bde5aa37b660 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..bde5aa37b660 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..0185fbffc32d --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..0185fbffc32d --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..d1eb69f25852 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..52c52eead146 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..36bc20ac6da6 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..97994f8b5a37 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..7fc2af2a254f --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..f3461782cd5a --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..ffa83901cc3a --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..892538889d13 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..b59ff29907a7 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 +DECLARE @argument BinaryDouble -- Double +SET @argument = 0.5D + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..69f6b78855a7 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..56dbd1a695a5 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + g_2."Key_1", + t1."c1", + g_2."c1" +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..04b84f252bdd --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + t."CategoryId", + t1."c1" +FROM + "WindowFunctionTestEntity" t + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."DecimalValue") as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..0aec817db1a7 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..43d38d96a617 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..94e759662de7 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..2dc24f578207 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..2f7b4ce112b0 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..8cdbb44485c3 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..99c4c7f3b28f --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..09f722fab331 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..36f9bfc0dc37 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed.LinqService).sql b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed.LinqService).sql new file mode 100644 index 000000000000..36f9bfc0dc37 --- /dev/null +++ b/Oracle.23.Managed.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed).sql new file mode 100644 index 000000000000..ef58b582272f --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.23.Managed).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed).sql new file mode 100644 index 000000000000..d2b40b5646d3 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..d2b40b5646d3 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + AVG(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + AVG(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed).sql new file mode 100644 index 000000000000..23b4961cb225 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..2d96d11fdd09 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed).sql new file mode 100644 index 000000000000..aef7a178a614 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithNulls(Oracle.23.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + CUME_DIST() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed).sql new file mode 100644 index 000000000000..d43307d0d618 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + CUME_DIST() OVER (ORDER BY x."Timestamp"), + CUME_DIST() OVER (ORDER BY x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC), + CUME_DIST() OVER (ORDER BY x."Value" DESC), + CUME_DIST() OVER (ORDER BY x."Timestamp", x."Value"), + CUME_DIST() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed).sql new file mode 100644 index 000000000000..9bf8005cf150 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..f146dcd238fe --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed).sql new file mode 100644 index 000000000000..8a74a251dedd --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithNulls(Oracle.23.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + DENSE_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed).sql new file mode 100644 index 000000000000..ee7fe2c8c04b --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + DENSE_RANK() OVER (ORDER BY x."Timestamp"), + DENSE_RANK() OVER (ORDER BY x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC), + DENSE_RANK() OVER (ORDER BY x."Value" DESC), + DENSE_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + DENSE_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed).sql new file mode 100644 index 000000000000..e32ffc40ac39 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameGroups(Oracle.23.Managed).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" GROUPS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed).sql new file mode 100644 index 000000000000..6d8206799b72 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(Oracle.23.Managed).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed).sql new file mode 100644 index 000000000000..3caa3fb578ac --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeValue(Oracle.23.Managed).sql @@ -0,0 +1,9 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed).sql new file mode 100644 index 000000000000..ff9b508ab6a7 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(Oracle.23.Managed).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id" ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed).sql new file mode 100644 index 000000000000..bde5aa37b660 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..bde5aa37b660 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MAX(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MAX(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed).sql new file mode 100644 index 000000000000..0185fbffc32d --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..0185fbffc32d --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."ByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + MIN(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed).sql new file mode 100644 index 000000000000..d1eb69f25852 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..52c52eead146 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed).sql new file mode 100644 index 000000000000..36bc20ac6da6 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithNulls(Oracle.23.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + NTILE(4) OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed).sql new file mode 100644 index 000000000000..97994f8b5a37 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + NTILE(4) OVER (ORDER BY x."Timestamp"), + NTILE(4) OVER (ORDER BY x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC), + NTILE(4) OVER (ORDER BY x."Value" DESC), + NTILE(4) OVER (ORDER BY x."Timestamp", x."Value"), + NTILE(4) OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed).sql new file mode 100644 index 000000000000..7fc2af2a254f --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..f3461782cd5a --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed).sql new file mode 100644 index 000000000000..ffa83901cc3a --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithNulls(Oracle.23.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + PERCENT_RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed).sql new file mode 100644 index 000000000000..892538889d13 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + PERCENT_RANK() OVER (ORDER BY x."Timestamp"), + PERCENT_RANK() OVER (ORDER BY x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC), + PERCENT_RANK() OVER (ORDER BY x."Value" DESC), + PERCENT_RANK() OVER (ORDER BY x."Timestamp", x."Value"), + PERCENT_RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed).sql new file mode 100644 index 000000000000..497898670d5f --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(Oracle.23.Managed).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 +DECLARE @argument BinaryDouble -- Double +SET @argument = 0.5D + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."DecimalValue") +FROM + "WindowFunctionTestEntity" t1 + +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 (asynchronously) +DECLARE @argument BinaryDouble -- Double +SET @argument = 0.5D + +SELECT + PERCENTILE_CONT(:argument) WITHIN GROUP (ORDER BY t1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" t1 + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed).sql new file mode 100644 index 000000000000..69f6b78855a7 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGrouping(Oracle.23.Managed).sql @@ -0,0 +1,14 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + g_1."CategoryId", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."DecimalValue"), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC), + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) +FROM + "WindowFunctionTestEntity" g_1 +GROUP BY + g_1."CategoryId" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed).sql new file mode 100644 index 000000000000..56dbd1a695a5 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileContGroupingProjection(Oracle.23.Managed).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + g_2."Key_1", + t1."c1", + g_2."c1" +FROM + ( + SELECT + g_1."CategoryId" as "Key_1", + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY g_1."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" g_1 + GROUP BY + g_1."CategoryId" + ) g_2 + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."IntValue" DESC) as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + g_2."Key_1" = x."CategoryId" + ) t1 + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed).sql new file mode 100644 index 000000000000..04b84f252bdd --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(Oracle.23.Managed).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + t."CategoryId", + t1."c1" +FROM + "WindowFunctionTestEntity" t + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5D) WITHIN GROUP (ORDER BY x."DecimalValue") as "c1" + FROM + "WindowFunctionTestEntity" x + WHERE + x."Id" > t."Id" AND x."DecimalValue" > 1 + ) t1 + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed).sql new file mode 100644 index 000000000000..0aec817db1a7 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..43d38d96a617 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + RANK() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed).sql new file mode 100644 index 000000000000..94e759662de7 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithNulls(Oracle.23.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + RANK() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed).sql new file mode 100644 index 000000000000..2dc24f578207 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + RANK() OVER (ORDER BY x."Timestamp"), + RANK() OVER (ORDER BY x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC), + RANK() OVER (ORDER BY x."Value" DESC), + RANK() OVER (ORDER BY x."Timestamp", x."Value"), + RANK() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed).sql new file mode 100644 index 000000000000..2f7b4ce112b0 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..8cdbb44485c3 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId", x."Name" ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed).sql new file mode 100644 index 000000000000..99c4c7f3b28f --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithNulls(Oracle.23.Managed).sql @@ -0,0 +1,30 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" NULLS FIRST), + ROW_NUMBER() OVER (PARTITION BY x."CategoryId" ORDER BY x."Timestamp" DESC NULLS LAST) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed).sql new file mode 100644 index 000000000000..09f722fab331 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(Oracle.23.Managed).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + x."Id", + x."Name", + x."CategoryId", + x."Value", + x."Timestamp", + x."IntValue", + x."NullableIntValue", + x."LongValue", + x."NullableLongValue", + x."DoubleValue", + x."NullableDoubleValue", + x."DecimalValue", + x."NullableDecimalValue", + x."FloatValue", + x."NullableFloatValue", + x."ShortValue", + x."NullableShortValue", + x."ByteValue", + x."NullableByteValue", + ROW_NUMBER() OVER (ORDER BY x."Timestamp"), + ROW_NUMBER() OVER (ORDER BY x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC), + ROW_NUMBER() OVER (ORDER BY x."Value" DESC), + ROW_NUMBER() OVER (ORDER BY x."Timestamp", x."Value"), + ROW_NUMBER() OVER (ORDER BY x."Timestamp" DESC, x."Value" DESC) +FROM + "WindowFunctionTestEntity" x +ORDER BY + x."Id" + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed).sql new file mode 100644 index 000000000000..36f9bfc0dc37 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + diff --git a/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed).sql new file mode 100644 index 000000000000..36f9bfc0dc37 --- /dev/null +++ b/Oracle.23.Managed/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(Oracle.23.Managed).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + SUM(t."IntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableIntValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."LongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableLongValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDoubleValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."DecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableDecimalValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."FloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableFloatValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ShortValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableShortValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(CAST(t."ByteValue" AS Int)) OVER (PARTITION BY t."CategoryId" ORDER BY t."Id"), + SUM(t."NullableByteValue") OVER (PARTITION BY t."CategoryId" ORDER BY t."Id") +FROM + "WindowFunctionTestEntity" t + From 94283eeee244143954af20ae73c28c6dc8e24de6 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 20:51:19 +0000 Subject: [PATCH 29/30] [Windows / SQL Server EXTRAS] baselines --- ...nctBy(SqlServer.Contained.LinqService).sql | 42 +++++++++++++++++++ ...loads(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...tions(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...ition(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...tions(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...ition(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...Value(SqlServer.Contained.LinqService).sql | 11 +++++ ...eRows(SqlServer.Contained.LinqService).sql | 13 ++++++ ...loads(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...loads(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...tions(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...ition(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...tions(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...ition(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...eCont(SqlServer.Contained.LinqService).sql | 10 +++++ ...query(SqlServer.Contained.LinqService).sql | 17 ++++++++ ...tions(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...ition(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...tions(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...ition(SqlServer.Contained.LinqService).sql | 34 +++++++++++++++ ...loads(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...indow(SqlServer.Contained.LinqService).sql | 21 ++++++++++ ...By(SqlServer.Contained.MS.LinqService).sql | 42 +++++++++++++++++++ ...ds(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...ns(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...on(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ns(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...on(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ue(SqlServer.Contained.MS.LinqService).sql | 11 +++++ ...ws(SqlServer.Contained.MS.LinqService).sql | 13 ++++++ ...ds(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...ds(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...ns(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...on(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ns(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...on(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...nt(SqlServer.Contained.MS.LinqService).sql | 10 +++++ ...ry(SqlServer.Contained.MS.LinqService).sql | 17 ++++++++ ...ns(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...on(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ns(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...on(SqlServer.Contained.MS.LinqService).sql | 34 +++++++++++++++ ...ds(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...ow(SqlServer.Contained.MS.LinqService).sql | 21 ++++++++++ ...sts.DistinctBy(SqlServer.Contained.MS).sql | 42 +++++++++++++++++++ ...erageOverloads(SqlServer.Contained.MS).sql | 21 ++++++++++ ...loadsViaWindow(SqlServer.Contained.MS).sql | 21 ++++++++++ ...iplePartitions(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thDefineWindow(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thoutPartition(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...iplePartitions(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thDefineWindow(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thoutPartition(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...meRangeNoValue(SqlServer.Contained.MS).sql | 11 +++++ ...ests.FrameRows(SqlServer.Contained.MS).sql | 13 ++++++ ...s.MaxOverloads(SqlServer.Contained.MS).sql | 21 ++++++++++ ...loadsViaWindow(SqlServer.Contained.MS).sql | 21 ++++++++++ ...s.MinOverloads(SqlServer.Contained.MS).sql | 21 ++++++++++ ...loadsViaWindow(SqlServer.Contained.MS).sql | 21 ++++++++++ ...iplePartitions(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thDefineWindow(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thoutPartition(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...iplePartitions(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thDefineWindow(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thoutPartition(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...PercentileCont(SqlServer.Contained.MS).sql | 20 +++++++++ ...entileSubquery(SqlServer.Contained.MS).sql | 17 ++++++++ ...iplePartitions(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thDefineWindow(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thoutPartition(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...iplePartitions(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thDefineWindow(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...thoutPartition(SqlServer.Contained.MS).sql | 34 +++++++++++++++ ...s.SumOverloads(SqlServer.Contained.MS).sql | 21 ++++++++++ ...loadsViaWindow(SqlServer.Contained.MS).sql | 21 ++++++++++ ...yTests.DistinctBy(SqlServer.Contained).sql | 42 +++++++++++++++++++ ....AverageOverloads(SqlServer.Contained).sql | 21 ++++++++++ ...verloadsViaWindow(SqlServer.Contained).sql | 21 ++++++++++ ...ultiplePartitions(SqlServer.Contained).sql | 34 +++++++++++++++ ...sWithDefineWindow(SqlServer.Contained).sql | 34 +++++++++++++++ ...tWithoutPartition(SqlServer.Contained).sql | 34 +++++++++++++++ ...ultiplePartitions(SqlServer.Contained).sql | 34 +++++++++++++++ ...sWithDefineWindow(SqlServer.Contained).sql | 34 +++++++++++++++ ...kWithoutPartition(SqlServer.Contained).sql | 34 +++++++++++++++ ...FrameRangeNoValue(SqlServer.Contained).sql | 11 +++++ ...nsTests.FrameRows(SqlServer.Contained).sql | 13 ++++++ ...ests.MaxOverloads(SqlServer.Contained).sql | 21 ++++++++++ ...verloadsViaWindow(SqlServer.Contained).sql | 21 ++++++++++ ...ests.MinOverloads(SqlServer.Contained).sql | 21 ++++++++++ ...verloadsViaWindow(SqlServer.Contained).sql | 21 ++++++++++ ...ultiplePartitions(SqlServer.Contained).sql | 34 +++++++++++++++ ...sWithDefineWindow(SqlServer.Contained).sql | 34 +++++++++++++++ ...eWithoutPartition(SqlServer.Contained).sql | 34 +++++++++++++++ ...ultiplePartitions(SqlServer.Contained).sql | 34 +++++++++++++++ ...sWithDefineWindow(SqlServer.Contained).sql | 34 +++++++++++++++ ...kWithoutPartition(SqlServer.Contained).sql | 34 +++++++++++++++ ...ts.PercentileCont(SqlServer.Contained).sql | 20 +++++++++ ...ercentileSubquery(SqlServer.Contained).sql | 17 ++++++++ ...ultiplePartitions(SqlServer.Contained).sql | 34 +++++++++++++++ ...sWithDefineWindow(SqlServer.Contained).sql | 34 +++++++++++++++ ...kWithoutPartition(SqlServer.Contained).sql | 34 +++++++++++++++ ...ultiplePartitions(SqlServer.Contained).sql | 34 +++++++++++++++ ...sWithDefineWindow(SqlServer.Contained).sql | 34 +++++++++++++++ ...rWithoutPartition(SqlServer.Contained).sql | 34 +++++++++++++++ ...ests.SumOverloads(SqlServer.Contained).sql | 21 ++++++++++ ...verloadsViaWindow(SqlServer.Contained).sql | 21 ++++++++++ ...s.DistinctBy(SqlServer.SA.LinqService).sql | 42 +++++++++++++++++++ ...ageOverloads(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...adsViaWindow(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...lePartitions(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...DefineWindow(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...outPartition(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...lePartitions(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...DefineWindow(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...outPartition(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...RangeNoValue(SqlServer.SA.LinqService).sql | 11 +++++ ...ts.FrameRows(SqlServer.SA.LinqService).sql | 13 ++++++ ...MaxOverloads(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...adsViaWindow(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...MinOverloads(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...adsViaWindow(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...lePartitions(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...DefineWindow(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...outPartition(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...lePartitions(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...DefineWindow(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...outPartition(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...rcentileCont(SqlServer.SA.LinqService).sql | 10 +++++ ...tileSubquery(SqlServer.SA.LinqService).sql | 17 ++++++++ ...lePartitions(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...DefineWindow(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...outPartition(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...lePartitions(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...DefineWindow(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...outPartition(SqlServer.SA.LinqService).sql | 34 +++++++++++++++ ...SumOverloads(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...adsViaWindow(SqlServer.SA.LinqService).sql | 21 ++++++++++ ...istinctBy(SqlServer.SA.MS.LinqService).sql | 42 +++++++++++++++++++ ...Overloads(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...ViaWindow(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...artitions(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...ineWindow(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...Partition(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...artitions(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...ineWindow(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...Partition(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...geNoValue(SqlServer.SA.MS.LinqService).sql | 11 +++++ ...FrameRows(SqlServer.SA.MS.LinqService).sql | 13 ++++++ ...Overloads(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...ViaWindow(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...Overloads(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...ViaWindow(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...artitions(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...ineWindow(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...Partition(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...artitions(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...ineWindow(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...Partition(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...ntileCont(SqlServer.SA.MS.LinqService).sql | 10 +++++ ...eSubquery(SqlServer.SA.MS.LinqService).sql | 17 ++++++++ ...artitions(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...ineWindow(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...Partition(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...artitions(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...ineWindow(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...Partition(SqlServer.SA.MS.LinqService).sql | 34 +++++++++++++++ ...Overloads(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...ViaWindow(SqlServer.SA.MS.LinqService).sql | 21 ++++++++++ ...nctByTests.DistinctBy(SqlServer.SA.MS).sql | 42 +++++++++++++++++++ ...ests.AverageOverloads(SqlServer.SA.MS).sql | 21 ++++++++++ ...ageOverloadsViaWindow(SqlServer.SA.MS).sql | 21 ++++++++++ ...ithMultiplePartitions(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...tionsWithDefineWindow(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...eDistWithoutPartition(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...ithMultiplePartitions(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...tionsWithDefineWindow(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...eRankWithoutPartition(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...sts.FrameRangeNoValue(SqlServer.SA.MS).sql | 11 +++++ ...ctionsTests.FrameRows(SqlServer.SA.MS).sql | 13 ++++++ ...onsTests.MaxOverloads(SqlServer.SA.MS).sql | 21 ++++++++++ ...MaxOverloadsViaWindow(SqlServer.SA.MS).sql | 21 ++++++++++ ...onsTests.MinOverloads(SqlServer.SA.MS).sql | 21 ++++++++++ ...MinOverloadsViaWindow(SqlServer.SA.MS).sql | 21 ++++++++++ ...ithMultiplePartitions(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...tionsWithDefineWindow(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...NTileWithoutPartition(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...ithMultiplePartitions(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...tionsWithDefineWindow(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...tRankWithoutPartition(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...sTests.PercentileCont(SqlServer.SA.MS).sql | 20 +++++++++ ...ts.PercentileSubquery(SqlServer.SA.MS).sql | 17 ++++++++ ...ithMultiplePartitions(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...tionsWithDefineWindow(SqlServer.SA.MS).sql | 34 +++++++++++++++ ....RankWithoutPartition(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...ithMultiplePartitions(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...tionsWithDefineWindow(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...umberWithoutPartition(SqlServer.SA.MS).sql | 34 +++++++++++++++ ...onsTests.SumOverloads(SqlServer.SA.MS).sql | 21 ++++++++++ ...SumOverloadsViaWindow(SqlServer.SA.MS).sql | 21 ++++++++++ ...stinctByTests.DistinctBy(SqlServer.SA).sql | 42 +++++++++++++++++++ ...nsTests.AverageOverloads(SqlServer.SA).sql | 21 ++++++++++ ...verageOverloadsViaWindow(SqlServer.SA).sql | 21 ++++++++++ ...stWithMultiplePartitions(SqlServer.SA).sql | 34 +++++++++++++++ ...rtitionsWithDefineWindow(SqlServer.SA).sql | 34 +++++++++++++++ ...CumeDistWithoutPartition(SqlServer.SA).sql | 34 +++++++++++++++ ...nkWithMultiplePartitions(SqlServer.SA).sql | 34 +++++++++++++++ ...rtitionsWithDefineWindow(SqlServer.SA).sql | 34 +++++++++++++++ ...enseRankWithoutPartition(SqlServer.SA).sql | 34 +++++++++++++++ ...sTests.FrameRangeNoValue(SqlServer.SA).sql | 11 +++++ ...FunctionsTests.FrameRows(SqlServer.SA).sql | 13 ++++++ ...ctionsTests.MaxOverloads(SqlServer.SA).sql | 21 ++++++++++ ...ts.MaxOverloadsViaWindow(SqlServer.SA).sql | 21 ++++++++++ ...ctionsTests.MinOverloads(SqlServer.SA).sql | 21 ++++++++++ ...ts.MinOverloadsViaWindow(SqlServer.SA).sql | 21 ++++++++++ ...leWithMultiplePartitions(SqlServer.SA).sql | 34 +++++++++++++++ ...rtitionsWithDefineWindow(SqlServer.SA).sql | 34 +++++++++++++++ ...ts.NTileWithoutPartition(SqlServer.SA).sql | 34 +++++++++++++++ ...nkWithMultiplePartitions(SqlServer.SA).sql | 34 +++++++++++++++ ...rtitionsWithDefineWindow(SqlServer.SA).sql | 34 +++++++++++++++ ...centRankWithoutPartition(SqlServer.SA).sql | 34 +++++++++++++++ ...ionsTests.PercentileCont(SqlServer.SA).sql | 20 +++++++++ ...Tests.PercentileSubquery(SqlServer.SA).sql | 17 ++++++++ ...nkWithMultiplePartitions(SqlServer.SA).sql | 34 +++++++++++++++ ...rtitionsWithDefineWindow(SqlServer.SA).sql | 34 +++++++++++++++ ...sts.RankWithoutPartition(SqlServer.SA).sql | 34 +++++++++++++++ ...erWithMultiplePartitions(SqlServer.SA).sql | 34 +++++++++++++++ ...rtitionsWithDefineWindow(SqlServer.SA).sql | 34 +++++++++++++++ ...owNumberWithoutPartition(SqlServer.SA).sql | 34 +++++++++++++++ ...ctionsTests.SumOverloads(SqlServer.SA).sql | 21 ++++++++++ ...ts.SumOverloadsViaWindow(SqlServer.SA).sql | 21 ++++++++++ 248 files changed, 7024 insertions(+) create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS).sql create mode 100644 SqlServer.Contained/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained).sql create mode 100644 SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS).sql create mode 100644 SqlServer.SA/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA).sql create mode 100644 SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA).sql diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..88ff7ab9e32a --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..b5a3ac3d238b --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..b5a3ac3d238b --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..a84f53507148 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..e6613fca39dc --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..0bc86dcd4d28 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..5ba1d8630e40 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..6ba7bc470819 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..7fffa8b006fb --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..ce8d206a701d --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..739b4d144a3b --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..651fa53c8e81 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..651fa53c8e81 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..b264162e799d --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..b264162e799d --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..5e0d688a2446 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..b5283605032c --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..f889f70b605b --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..8c41f673be1a --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..bc66f6bdaf62 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..95f4503b9793 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..102ef613ac06 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..74dbbdcc8f25 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..5f1bfd0506de --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..0e88da8e4fc6 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..80588a27e442 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..072b4e12cf52 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..1537fbb80aa4 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..6b5e30435f66 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..d6d2e8292f03 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..d6d2e8292f03 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..c1a5f41c6a16 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..700a7fe4cdcf --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..700a7fe4cdcf --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..050d1f04d9a7 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..09ca94b0fa2d --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..ce2b3a95ed2b --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..f198f9b786d0 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..de69fa6df5bc --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..ff914ca147fd --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..a5d45afe9594 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..cc4177a82e65 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..cd3a8afec0e8 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..cd3a8afec0e8 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..2d60ca820448 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..2d60ca820448 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..1a33a1ef8d8c --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..d00b642f82f0 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..dba87afa9d05 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..374bc15997e2 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..f1c89f42127a --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..3d23bcd57b66 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..bd7596f642f7 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..3e63e5f8539e --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..c17a18a82649 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..4b3c9d22a5d8 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..7f5a2f3f3060 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..dbd4ceb3d572 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..98baf8694474 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..040b021204aa --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..069ad7c8ee70 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..069ad7c8ee70 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..c1a5f41c6a16 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..700a7fe4cdcf --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..700a7fe4cdcf --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..050d1f04d9a7 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..09ca94b0fa2d --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..ce2b3a95ed2b --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..f198f9b786d0 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..de69fa6df5bc --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..ff914ca147fd --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..a5d45afe9594 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..cc4177a82e65 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..cd3a8afec0e8 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..cd3a8afec0e8 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..2d60ca820448 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..2d60ca820448 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..1a33a1ef8d8c --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..d00b642f82f0 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..dba87afa9d05 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..374bc15997e2 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..f1c89f42127a --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..3d23bcd57b66 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..fa21e436657e --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..3e63e5f8539e --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..c17a18a82649 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..4b3c9d22a5d8 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..7f5a2f3f3060 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..dbd4ceb3d572 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..98baf8694474 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..040b021204aa --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..069ad7c8ee70 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..069ad7c8ee70 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained).sql new file mode 100644 index 000000000000..88ff7ab9e32a --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained).sql new file mode 100644 index 000000000000..b5a3ac3d238b --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..b5a3ac3d238b --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained).sql new file mode 100644 index 000000000000..a84f53507148 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..e6613fca39dc --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained).sql new file mode 100644 index 000000000000..0bc86dcd4d28 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained).sql new file mode 100644 index 000000000000..5ba1d8630e40 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..6ba7bc470819 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained).sql new file mode 100644 index 000000000000..7fffa8b006fb --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained).sql new file mode 100644 index 000000000000..ce8d206a701d --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.Contained).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained).sql new file mode 100644 index 000000000000..739b4d144a3b --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.Contained).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained).sql new file mode 100644 index 000000000000..651fa53c8e81 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..651fa53c8e81 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained).sql new file mode 100644 index 000000000000..b264162e799d --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..b264162e799d --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained).sql new file mode 100644 index 000000000000..5e0d688a2446 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..b5283605032c --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained).sql new file mode 100644 index 000000000000..f889f70b605b --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained).sql new file mode 100644 index 000000000000..8c41f673be1a --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..bc66f6bdaf62 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained).sql new file mode 100644 index 000000000000..95f4503b9793 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained).sql new file mode 100644 index 000000000000..e2ed31913e07 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.Contained).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained).sql new file mode 100644 index 000000000000..74dbbdcc8f25 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.Contained).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained).sql new file mode 100644 index 000000000000..5f1bfd0506de --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..0e88da8e4fc6 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained).sql new file mode 100644 index 000000000000..80588a27e442 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained).sql new file mode 100644 index 000000000000..072b4e12cf52 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..1537fbb80aa4 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained).sql new file mode 100644 index 000000000000..6b5e30435f66 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained).sql new file mode 100644 index 000000000000..d6d2e8292f03 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained).sql new file mode 100644 index 000000000000..d6d2e8292f03 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.Contained).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..af1f1de35c36 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..1366d5551981 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..1366d5551981 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..392eb52dd713 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..c0f0853c7e07 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..0bc3ccce7007 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..4dc3f298241c --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..8c108388065f --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..637ca4b699f8 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..fa9827e99063 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..764546577dcc --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..e7408d4d43d8 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..e7408d4d43d8 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..2876884e48de --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..2876884e48de --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..b5a5f151b1ae --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..52cf315e1b7f --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..bb30425e8ee6 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..6fe97c3535b7 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..861e4127893c --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..52e224cc1989 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..0b843151b27f --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..f5e0847389e3 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..ccc9200d39b3 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..26018d35f39f --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..dee348fda766 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..97874a3c88e0 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..59163c1bce11 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..8f825a2f303c --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..c47e3ddf3555 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..c47e3ddf3555 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..8442c3f0a216 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..a7efd2e43b2d --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..a7efd2e43b2d --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..6f65b13f5dd6 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..c37407c1bf68 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..a69f0e8b5225 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..e942e7556dae --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..070e3382696b --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..844779d19f8c --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..8752312ce18b --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..925863552be1 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..519f84e80e2a --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..519f84e80e2a --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..624143902412 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..624143902412 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..1ee46c87886c --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..a0d2b1326c5c --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..2d8952b497ef --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..d63810e9cc4d --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..a29cb1665129 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..318fdd669100 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..7ab10a667203 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..04543a2665ee --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..d83814f9d591 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..5503761fc395 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..df2829c6e312 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..2e94d343173b --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..a1a6b1ea3c4d --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..9712d995f7cd --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..2d9ad7ca6729 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..2d9ad7ca6729 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..8442c3f0a216 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a7efd2e43b2d --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a7efd2e43b2d --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..6f65b13f5dd6 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..c37407c1bf68 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a69f0e8b5225 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..e942e7556dae --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..070e3382696b --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..844779d19f8c --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..8752312ce18b --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA.MS).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..925863552be1 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA.MS).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..519f84e80e2a --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..519f84e80e2a --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..624143902412 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..624143902412 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..1ee46c87886c --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a0d2b1326c5c --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..2d8952b497ef --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..d63810e9cc4d --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a29cb1665129 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..318fdd669100 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..0d821090a6dc --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA.MS).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..04543a2665ee --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..d83814f9d591 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..5503761fc395 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..df2829c6e312 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..2e94d343173b --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a1a6b1ea3c4d --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..9712d995f7cd --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..2d9ad7ca6729 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..2d9ad7ca6729 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA).sql new file mode 100644 index 000000000000..af1f1de35c36 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA).sql new file mode 100644 index 000000000000..1366d5551981 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloads(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..1366d5551981 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.AverageOverloadsViaWindow(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + AVG([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + AVG([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA).sql new file mode 100644 index 000000000000..392eb52dd713 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitions(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..c0f0853c7e07 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA).sql new file mode 100644 index 000000000000..0bc3ccce7007 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.CumeDistWithoutPartition(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + CUME_DIST() OVER (ORDER BY [x].[Timestamp]), + CUME_DIST() OVER (ORDER BY [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC), + CUME_DIST() OVER (ORDER BY [x].[Value] DESC), + CUME_DIST() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + CUME_DIST() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA).sql new file mode 100644 index 000000000000..4dc3f298241c --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitions(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..8c108388065f --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA).sql new file mode 100644 index 000000000000..637ca4b699f8 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.DenseRankWithoutPartition(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + DENSE_RANK() OVER (ORDER BY [x].[Timestamp]), + DENSE_RANK() OVER (ORDER BY [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Value] DESC), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + DENSE_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA).sql new file mode 100644 index 000000000000..fa9827e99063 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRangeNoValue(SqlServer.SA).sql @@ -0,0 +1,11 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] RANGE BETWEEN CURRENT ROW AND CURRENT ROW) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA).sql new file mode 100644 index 000000000000..764546577dcc --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.FrameRows(SqlServer.SA).sql @@ -0,0 +1,13 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN CURRENT ROW AND CURRENT ROW), + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id] ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA).sql new file mode 100644 index 000000000000..e7408d4d43d8 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloads(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..e7408d4d43d8 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MaxOverloadsViaWindow(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MAX([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MAX([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA).sql new file mode 100644 index 000000000000..2876884e48de --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloads(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..2876884e48de --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.MinOverloadsViaWindow(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MIN([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[ByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + MIN([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA).sql new file mode 100644 index 000000000000..b5a5f151b1ae --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitions(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..52cf315e1b7f --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA).sql new file mode 100644 index 000000000000..bb30425e8ee6 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.NTileWithoutPartition(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + NTILE(4) OVER (ORDER BY [x].[Timestamp]), + NTILE(4) OVER (ORDER BY [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC), + NTILE(4) OVER (ORDER BY [x].[Value] DESC), + NTILE(4) OVER (ORDER BY [x].[Timestamp], [x].[Value]), + NTILE(4) OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA).sql new file mode 100644 index 000000000000..6fe97c3535b7 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitions(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..861e4127893c --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA).sql new file mode 100644 index 000000000000..52e224cc1989 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentRankWithoutPartition(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp]), + PERCENT_RANK() OVER (ORDER BY [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Value] DESC), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + PERCENT_RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA).sql new file mode 100644 index 000000000000..be21f64bf559 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileCont(SqlServer.SA).sql @@ -0,0 +1,20 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[DecimalValue]) OVER () +FROM + [WindowFunctionTestEntity] [t1] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) +DECLARE @argument Float -- Double +SET @argument = 0.5 + +SELECT + PERCENTILE_CONT(@argument) WITHIN GROUP (ORDER BY [t1].[IntValue] DESC) OVER () +FROM + [WindowFunctionTestEntity] [t1] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA).sql new file mode 100644 index 000000000000..f5e0847389e3 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.PercentileSubquery(SqlServer.SA).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t].[CategoryId], + [t1].[c1] +FROM + [WindowFunctionTestEntity] [t] + OUTER APPLY ( + SELECT + PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY [x].[DecimalValue]) OVER () as [c1] + FROM + [WindowFunctionTestEntity] [x] + WHERE + [x].[Id] > [t].[Id] AND [x].[DecimalValue] > 1 + ) [t1] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA).sql new file mode 100644 index 000000000000..ccc9200d39b3 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitions(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..26018d35f39f --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA).sql new file mode 100644 index 000000000000..dee348fda766 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RankWithoutPartition(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + RANK() OVER (ORDER BY [x].[Timestamp]), + RANK() OVER (ORDER BY [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC), + RANK() OVER (ORDER BY [x].[Value] DESC), + RANK() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + RANK() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA).sql new file mode 100644 index 000000000000..97874a3c88e0 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitions(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..59163c1bce11 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithMultiplePartitionsWithDefineWindow(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId] ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (PARTITION BY [x].[CategoryId], [x].[Name] ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA).sql new file mode 100644 index 000000000000..8f825a2f303c --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.RowNumberWithoutPartition(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[Id], + [x].[Name], + [x].[CategoryId], + [x].[Value], + [x].[Timestamp], + [x].[IntValue], + [x].[NullableIntValue], + [x].[LongValue], + [x].[NullableLongValue], + [x].[DoubleValue], + [x].[NullableDoubleValue], + [x].[DecimalValue], + [x].[NullableDecimalValue], + [x].[FloatValue], + [x].[NullableFloatValue], + [x].[ShortValue], + [x].[NullableShortValue], + [x].[ByteValue], + [x].[NullableByteValue], + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp]), + ROW_NUMBER() OVER (ORDER BY [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Value] DESC), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp], [x].[Value]), + ROW_NUMBER() OVER (ORDER BY [x].[Timestamp] DESC, [x].[Value] DESC) +FROM + [WindowFunctionTestEntity] [x] +ORDER BY + [x].[Id] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA).sql new file mode 100644 index 000000000000..c47e3ddf3555 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloads(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + diff --git a/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA).sql new file mode 100644 index 000000000000..c47e3ddf3555 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/WindowFunctionsTests/Tests.Linq.WindowFunctionsTests.SumOverloadsViaWindow(SqlServer.SA).sql @@ -0,0 +1,21 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + SUM([t].[IntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableIntValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[LongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableLongValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDoubleValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[DecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableDecimalValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[FloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableFloatValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[ShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableShortValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM(CAST([t].[ByteValue] AS Int)) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]), + SUM([t].[NullableByteValue]) OVER (PARTITION BY [t].[CategoryId] ORDER BY [t].[Id]) +FROM + [WindowFunctionTestEntity] [t] + From 242ecc5ea12480042679a1a9bbeaa2768d0340c1 Mon Sep 17 00:00:00 2001 From: Azure Pipelines Bot Date: Thu, 13 Mar 2025 21:06:30 +0000 Subject: [PATCH 30/30] [Linux / SAP HANA 2] baselines --- ...s.DistinctBy(SapHana.Odbc.LinqService).sql | 42 +++++++++++++++++++ ...stinctByTests.DistinctBy(SapHana.Odbc).sql | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 SapHana.Odbc.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc.LinqService).sql create mode 100644 SapHana.Odbc/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc).sql diff --git a/SapHana.Odbc.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..c5c11cdbfe50 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc).sql new file mode 100644 index 000000000000..c5c11cdbfe50 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" +