SQL Server (Transact SQL) support for pmin and pmax functions can easily be added.
Lines 295f in tidyverse dbplyr/R/backend-mssql.R state pmin, pmax not supported. But SQL Server (Transact SQL supports this:
SQL Server (Transact SQL) supports LEAST and GREATEST as already implemented in backend-.R,
see https://learn.microsoft.com/en-us/sql/t-sql/functions/logical-functions-least-transact-sql?view=sql-server-ver16
Therefore I propose to remove
pmin = sql_not_supported("pmin"),
pmax = sql_not_supported("pmax"),
which allows dbplyr/R/backend-.R lines 217f covers to work as expected
pmin = sql_aggregate_n("LEAST", "pmin"),
pmax = sql_aggregate_n("GREATEST", "pmax"),
and that is supported in SQL Server and Transact SQL.
Tested this locally on my fork using DBI and odbc: "ODBC Driver 18 for SQL Server", and it worked.
Can I create a pull request?
SQL Server (Transact SQL) support for pmin and pmax functions can easily be added.
Lines 295f in tidyverse
dbplyr/R/backend-mssql.Rstate pmin, pmax not supported. But SQL Server (Transact SQL supports this:SQL Server (Transact SQL) supports
LEASTandGREATESTas already implemented inbackend-.R,see https://learn.microsoft.com/en-us/sql/t-sql/functions/logical-functions-least-transact-sql?view=sql-server-ver16
Therefore I propose to remove
which allows
dbplyr/R/backend-.Rlines 217f covers to work as expectedand that is supported in SQL Server and Transact SQL.
Tested this locally on my fork using DBI and odbc: "ODBC Driver 18 for SQL Server", and it worked.
Can I create a pull request?