Table of Contents

Class CommonFunctions

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Surface of SQL functions and predicates that can be used inside query expressions. The SQL providers evaluate the members through the expression translator; the in-memory provider rewrites the small subset that has a native CLR equivalent.

public class CommonFunctions
Inheritance
CommonFunctions
Derived
Inherited Members
Extension Methods

Remarks

Renamed from NORM_SQL. The MethodInfo fields and SQLExpression are implementation details and are now internal. See docs/specs/design/API-NAMING-REVIEW.md finding P1-10.

Methods

all<T>(QueryCommand<T>)

all(subquery): the ALL subquery quantifier, true when every row of the subquery satisfies the comparison.

public T all<T>(QueryCommand<T> cmd)

Parameters

cmd QueryCommand<T>

The subquery.

Returns

T

Type Parameters

T

The subquery result type.

any_agg<T>(T?)

any_value(property): an arbitrary value from the group. Distinct from the any<T>(QueryCommand<T>) subquery quantifier, hence the name. Rendered as ANY_VALUE(x) by MySQL and as any(x) by ClickHouse; MariaDB has no ANY_VALUE yet, so it is gated off. Requires a provider that supports it (see SupportsAnyValueAggregate).

public T? any_agg<T>(T? property)

Parameters

property T

Returns

T

Type Parameters

T

any<T>(QueryCommand<T>)

any(subquery): the ANY subquery quantifier, true when any row of the subquery satisfies the comparison. Distinct from any_agg, the arbitrary-value aggregate.

public T any<T>(QueryCommand<T> cmd)

Parameters

cmd QueryCommand<T>

The subquery.

Returns

T

Type Parameters

T

The subquery result type.

asc(Expression<Func<object?>>)

Order key of a window specification rendered as asc.

public WindowOrder asc(Expression<Func<object?>> expression)

Parameters

expression Expression<Func<object>>

Returns

WindowOrder

ascii(string?)

ascii(value): the code point of the first character of value (0 for an empty string). Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public int? ascii(string? value)

Parameters

value string

Returns

int?

avg(byte)

avg aggregate over byte values; the mean is the fractional double value of the non-null rows.

public double? avg(byte property)

Parameters

property byte

The value to aggregate.

Returns

double?

avg(byte, Expression<Func<bool>>)

Filtered avg(property) over byte values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(byte property, Expression<Func<bool>> filter)

Parameters

property byte

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(decimal)

avg aggregate over decimal values; the mean is the fractional decimal value of the non-null rows.

public decimal? avg(decimal property)

Parameters

property decimal

The value to aggregate.

Returns

decimal?

avg(decimal, Expression<Func<bool>>)

Filtered avg(property) over decimal values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional decimal.

public decimal? avg(decimal property, Expression<Func<bool>> filter)

Parameters

property decimal

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

decimal?

avg(double)

avg aggregate over double values; the mean is the fractional double value of the non-null rows.

public double? avg(double property)

Parameters

property double

The value to aggregate.

Returns

double?

avg(double, Expression<Func<bool>>)

Filtered avg(property) over double values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(double property, Expression<Func<bool>> filter)

Parameters

property double

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(short)

avg aggregate over short values; the mean is the fractional double value of the non-null rows.

public double? avg(short property)

Parameters

property short

The value to aggregate.

Returns

double?

avg(short, Expression<Func<bool>>)

Filtered avg(property) over short values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(short property, Expression<Func<bool>> filter)

Parameters

property short

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(int)

avg aggregate over int values; the mean is the fractional double value of the non-null rows.

public double? avg(int property)

Parameters

property int

The value to aggregate.

Returns

double?

avg(int, Expression<Func<bool>>)

Filtered avg(property) over int values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(int property, Expression<Func<bool>> filter)

Parameters

property int

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(long)

avg aggregate over long values; the mean is the fractional double value of the non-null rows.

public double? avg(long property)

Parameters

property long

The value to aggregate.

Returns

double?

avg(long, Expression<Func<bool>>)

Filtered avg(property) over long values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(long property, Expression<Func<bool>> filter)

Parameters

property long

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(byte?)

avg aggregate over nullable byte values; null rows are ignored and the mean is the fractional double value.

public double? avg(byte? property)

Parameters

property byte?

The value to aggregate.

Returns

double?

avg(byte?, Expression<Func<bool>>)

Filtered avg(property) over nullable byte values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(byte? property, Expression<Func<bool>> filter)

Parameters

property byte?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(decimal?)

avg aggregate over nullable decimal values; null rows are ignored and the mean is the fractional decimal value.

public decimal? avg(decimal? property)

Parameters

property decimal?

The value to aggregate.

Returns

decimal?

avg(decimal?, Expression<Func<bool>>)

Filtered avg(property) over nullable decimal values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional decimal.

public decimal? avg(decimal? property, Expression<Func<bool>> filter)

Parameters

property decimal?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

decimal?

avg(double?)

avg aggregate over nullable double values; null rows are ignored and the mean is the fractional double value.

public double? avg(double? property)

Parameters

property double?

The value to aggregate.

Returns

double?

avg(double?, Expression<Func<bool>>)

Filtered avg(property) over nullable double values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(double? property, Expression<Func<bool>> filter)

Parameters

property double?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(short?)

avg aggregate over nullable short values; null rows are ignored and the mean is the fractional double value.

public double? avg(short? property)

Parameters

property short?

The value to aggregate.

Returns

double?

avg(short?, Expression<Func<bool>>)

Filtered avg(property) over nullable short values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(short? property, Expression<Func<bool>> filter)

Parameters

property short?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(int?)

avg aggregate over nullable int values; null rows are ignored and the mean is the fractional double value.

public double? avg(int? property)

Parameters

property int?

The value to aggregate.

Returns

double?

avg(int?, Expression<Func<bool>>)

Filtered avg(property) over nullable int values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(int? property, Expression<Func<bool>> filter)

Parameters

property int?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(long?)

avg aggregate over nullable long values; null rows are ignored and the mean is the fractional double value.

public double? avg(long? property)

Parameters

property long?

The value to aggregate.

Returns

double?

avg(long?, Expression<Func<bool>>)

Filtered avg(property) over nullable long values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(long? property, Expression<Func<bool>> filter)

Parameters

property long?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(sbyte?)

avg aggregate over nullable sbyte values; null rows are ignored and the mean is the fractional double value.

public double? avg(sbyte? property)

Parameters

property sbyte?

The value to aggregate.

Returns

double?

avg(sbyte?, Expression<Func<bool>>)

Filtered avg(property) over nullable sbyte values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(sbyte? property, Expression<Func<bool>> filter)

Parameters

property sbyte?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(float?)

avg aggregate over nullable float values; null rows are ignored and the mean is the fractional float value.

public float? avg(float? property)

Parameters

property float?

The value to aggregate.

Returns

float?

avg(float?, Expression<Func<bool>>)

Filtered avg(property) over nullable float values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional float.

public float? avg(float? property, Expression<Func<bool>> filter)

Parameters

property float?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

float?

avg(ushort?)

avg aggregate over nullable ushort values; null rows are ignored and the mean is the fractional double value.

public double? avg(ushort? property)

Parameters

property ushort?

The value to aggregate.

Returns

double?

avg(ushort?, Expression<Func<bool>>)

Filtered avg(property) over nullable ushort values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(ushort? property, Expression<Func<bool>> filter)

Parameters

property ushort?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(uint?)

avg aggregate over nullable uint values; null rows are ignored and the mean is the fractional double value.

public double? avg(uint? property)

Parameters

property uint?

The value to aggregate.

Returns

double?

avg(uint?, Expression<Func<bool>>)

Filtered avg(property) over nullable uint values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(uint? property, Expression<Func<bool>> filter)

Parameters

property uint?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(ulong?)

avg aggregate over nullable ulong values; null rows are ignored and the mean is the fractional double value.

public double? avg(ulong? property)

Parameters

property ulong?

The value to aggregate.

Returns

double?

avg(ulong?, Expression<Func<bool>>)

Filtered avg(property) over nullable ulong values (the ANSI filter (where ...) clause or the ClickHouse avgIf); null rows are ignored and the mean is a fractional double.

public double? avg(ulong? property, Expression<Func<bool>> filter)

Parameters

property ulong?

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(sbyte)

avg aggregate over sbyte values; the mean is the fractional double value of the non-null rows.

public double? avg(sbyte property)

Parameters

property sbyte

The value to aggregate.

Returns

double?

avg(sbyte, Expression<Func<bool>>)

Filtered avg(property) over sbyte values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(sbyte property, Expression<Func<bool>> filter)

Parameters

property sbyte

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(float)

avg aggregate over float values; the mean is the fractional float value of the non-null rows.

public float? avg(float property)

Parameters

property float

The value to aggregate.

Returns

float?

avg(float, Expression<Func<bool>>)

Filtered avg(property) over float values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional float.

public float? avg(float property, Expression<Func<bool>> filter)

Parameters

property float

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

float?

avg(ushort)

avg aggregate over ushort values; the mean is the fractional double value of the non-null rows.

public double? avg(ushort property)

Parameters

property ushort

The value to aggregate.

Returns

double?

avg(ushort, Expression<Func<bool>>)

Filtered avg(property) over ushort values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(ushort property, Expression<Func<bool>> filter)

Parameters

property ushort

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(uint)

avg aggregate over uint values; the mean is the fractional double value of the non-null rows.

public double? avg(uint property)

Parameters

property uint

The value to aggregate.

Returns

double?

avg(uint, Expression<Func<bool>>)

Filtered avg(property) over uint values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(uint property, Expression<Func<bool>> filter)

Parameters

property uint

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg(ulong)

avg aggregate over ulong values; the mean is the fractional double value of the non-null rows.

public double? avg(ulong property)

Parameters

property ulong

The value to aggregate.

Returns

double?

avg(ulong, Expression<Func<bool>>)

Filtered avg(property) over ulong values (the ANSI filter (where ...) clause or the ClickHouse avgIf); the mean is a fractional double.

public double? avg(ulong property, Expression<Func<bool>> filter)

Parameters

property ulong

The value to aggregate.

filter Expression<Func<bool>>

The predicate the aggregated rows must satisfy.

Returns

double?

avg_distinct(byte)

avg(distinct ...) over byte values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(byte property)

Parameters

property byte

The value to aggregate.

Returns

double?

avg_distinct(decimal)

avg(distinct ...) over decimal values: the mean of the distinct non-null rows as a fractional decimal.

public decimal? avg_distinct(decimal property)

Parameters

property decimal

The value to aggregate.

Returns

decimal?

avg_distinct(double)

avg(distinct ...) over double values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(double property)

Parameters

property double

The value to aggregate.

Returns

double?

avg_distinct(short)

avg(distinct ...) over short values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(short property)

Parameters

property short

The value to aggregate.

Returns

double?

avg_distinct(int)

avg(distinct ...) over int values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(int property)

Parameters

property int

The value to aggregate.

Returns

double?

avg_distinct(long)

avg(distinct ...) over long values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(long property)

Parameters

property long

The value to aggregate.

Returns

double?

avg_distinct(byte?)

avg(distinct ...) over nullable byte values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(byte? property)

Parameters

property byte?

The value to aggregate.

Returns

double?

avg_distinct(decimal?)

avg(distinct ...) over nullable decimal values: null rows are ignored and the mean is a fractional decimal.

public decimal? avg_distinct(decimal? property)

Parameters

property decimal?

The value to aggregate.

Returns

decimal?

avg_distinct(double?)

avg(distinct ...) over nullable double values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(double? property)

Parameters

property double?

The value to aggregate.

Returns

double?

avg_distinct(short?)

avg(distinct ...) over nullable short values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(short? property)

Parameters

property short?

The value to aggregate.

Returns

double?

avg_distinct(int?)

avg(distinct ...) over nullable int values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(int? property)

Parameters

property int?

The value to aggregate.

Returns

double?

avg_distinct(long?)

avg(distinct ...) over nullable long values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(long? property)

Parameters

property long?

The value to aggregate.

Returns

double?

avg_distinct(sbyte?)

avg(distinct ...) over nullable sbyte values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(sbyte? property)

Parameters

property sbyte?

The value to aggregate.

Returns

double?

avg_distinct(float?)

avg(distinct ...) over nullable float values: null rows are ignored and the mean is a fractional float.

public float? avg_distinct(float? property)

Parameters

property float?

The value to aggregate.

Returns

float?

avg_distinct(ushort?)

avg(distinct ...) over nullable ushort values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(ushort? property)

Parameters

property ushort?

The value to aggregate.

Returns

double?

avg_distinct(uint?)

avg(distinct ...) over nullable uint values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(uint? property)

Parameters

property uint?

The value to aggregate.

Returns

double?

avg_distinct(ulong?)

avg(distinct ...) over nullable ulong values: null rows are ignored and the mean is a fractional double.

public double? avg_distinct(ulong? property)

Parameters

property ulong?

The value to aggregate.

Returns

double?

avg_distinct(sbyte)

avg(distinct ...) over sbyte values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(sbyte property)

Parameters

property sbyte

The value to aggregate.

Returns

double?

avg_distinct(float)

avg(distinct ...) over float values: the mean of the distinct non-null rows as a fractional float.

public float? avg_distinct(float property)

Parameters

property float

The value to aggregate.

Returns

float?

avg_distinct(ushort)

avg(distinct ...) over ushort values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(ushort property)

Parameters

property ushort

The value to aggregate.

Returns

double?

avg_distinct(uint)

avg(distinct ...) over uint values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(uint property)

Parameters

property uint

The value to aggregate.

Returns

double?

avg_distinct(ulong)

avg(distinct ...) over ulong values: the mean of the distinct non-null rows as a fractional double.

public double? avg_distinct(ulong property)

Parameters

property ulong

The value to aggregate.

Returns

double?

avg_over(byte)

Windowed avg over byte values; the window result is a fractional double.

public WindowFunction<double?> avg_over(byte property)

Parameters

property byte

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(decimal)

Windowed avg over decimal values; the window result is a fractional decimal.

public WindowFunction<decimal?> avg_over(decimal property)

Parameters

property decimal

The value to aggregate.

Returns

WindowFunction<decimal?>

avg_over(double)

Windowed avg over double values; the window result is a fractional double.

public WindowFunction<double?> avg_over(double property)

Parameters

property double

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(short)

Windowed avg over short values; the window result is a fractional double.

public WindowFunction<double?> avg_over(short property)

Parameters

property short

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(int)

Windowed avg over int values; the window result is a fractional double.

public WindowFunction<double?> avg_over(int property)

Parameters

property int

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(long)

Windowed avg over long values; the window result is a fractional double.

public WindowFunction<double?> avg_over(long property)

Parameters

property long

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(byte?)

Windowed avg over nullable byte values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(byte? property)

Parameters

property byte?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(decimal?)

Windowed avg over nullable decimal values; null rows are ignored and the window result is a fractional decimal.

public WindowFunction<decimal?> avg_over(decimal? property)

Parameters

property decimal?

The value to aggregate.

Returns

WindowFunction<decimal?>

avg_over(double?)

Windowed avg over nullable double values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(double? property)

Parameters

property double?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(short?)

Windowed avg over nullable short values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(short? property)

Parameters

property short?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(int?)

Windowed avg over nullable int values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(int? property)

Parameters

property int?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(long?)

Windowed avg over nullable long values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(long? property)

Parameters

property long?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(sbyte?)

Windowed avg over nullable sbyte values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(sbyte? property)

Parameters

property sbyte?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(float?)

Windowed avg over nullable float values; null rows are ignored and the window result is a fractional float.

public WindowFunction<float?> avg_over(float? property)

Parameters

property float?

The value to aggregate.

Returns

WindowFunction<float?>

avg_over(ushort?)

Windowed avg over nullable ushort values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(ushort? property)

Parameters

property ushort?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(uint?)

Windowed avg over nullable uint values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(uint? property)

Parameters

property uint?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(ulong?)

Windowed avg over nullable ulong values; null rows are ignored and the window result is a fractional double.

public WindowFunction<double?> avg_over(ulong? property)

Parameters

property ulong?

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(sbyte)

Windowed avg over sbyte values; the window result is a fractional double.

public WindowFunction<double?> avg_over(sbyte property)

Parameters

property sbyte

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(float)

Windowed avg over float values; the window result is a fractional float.

public WindowFunction<float?> avg_over(float property)

Parameters

property float

The value to aggregate.

Returns

WindowFunction<float?>

avg_over(ushort)

Windowed avg over ushort values; the window result is a fractional double.

public WindowFunction<double?> avg_over(ushort property)

Parameters

property ushort

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(uint)

Windowed avg over uint values; the window result is a fractional double.

public WindowFunction<double?> avg_over(uint property)

Parameters

property uint

The value to aggregate.

Returns

WindowFunction<double?>

avg_over(ulong)

Windowed avg over ulong values; the window result is a fractional double.

public WindowFunction<double?> avg_over(ulong property)

Parameters

property ulong

The value to aggregate.

Returns

WindowFunction<double?>

base64_decode(string?)

base64_decode(value): the binary value of the standard base64 (RFC 4648) text value. SQL NULL (including a NULL argument) yields SQL NULL. The input domain is canonical base64; invalid or URL-safe input is not normalized and the provider error is not masked. Requires a provider that supports it (see SupportsBase64Decode and MakeBase64Decode(string)).

public byte[]? base64_decode(string? value)

Parameters

value string

Returns

byte[]

base64_encode(byte[]?)

base64_encode(value): the standard base64 (RFC 4648) text of value, with +// and = padding and no line wrapping. SQL NULL (including a NULL argument) yields SQL NULL. Requires a provider that supports it (see SupportsBase64Encode and MakeBase64Encode(string)); SQL Server, PostgreSQL, MySQL and MariaDB render it natively, and every other provider rejects the call.

public string? base64_encode(byte[]? value)

Parameters

value byte[]

Returns

string

bit_length(string?)

bit_length(value): the number of bits in the string's octets (8 × octet_length(string?)). Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public int? bit_length(string? value)

Parameters

value string

Returns

int?

char(int)

char(code): the character with the given code point (the SQL char/chr, declared as @char because char is a C# keyword). Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? @char(int code)

Parameters

code int

Returns

string

collate(string?, string?)

value collate collation: applies a provider-native collation to a string operand, which determines how it compares and orders. collation must be a constant string naming a collation the provider understands (for example "C" on PostgreSQL, "Latin1_General_100_BIN2" on SQL Server). Requires a provider that supports per-expression collation (see SupportsCollation); ClickHouse has no COLLATE clause.

public string? collate(string? value, string? collation)

Parameters

value string

The string operand to collate.

collation string

The provider-native collation name (a constant).

Returns

string

Remarks

The in-memory provider executes the call natively and returns the value unchanged, because its comparisons are already ordinal (the collation argument is ignored).

concat_ws(string?, params object?[])

concat_ws(separator, ...): joins the values with separator. Null arguments are skipped on PostgreSQL, SQL Server, MySQL/MariaDB and SQLite; ClickHouse's concatWithSeparator returns NULL when any argument is NULL. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? concat_ws(string? separator, params object?[] values)

Parameters

separator string
values object[]

Returns

string

connection_id()

The server-side connection id as an unsigned 64-bit value (MySQL/MariaDB CAST(CONNECTION_ID() AS UNSIGNED), ClickHouse CAST(connectionId() AS UInt64)). It identifies the connection, not the user. Requires a provider that supports it (see SessionInfoFunctions).

public ulong connection_id()

Returns

ulong

contains<T>(T?, string?)

contains(column, search): true when the full-text-indexed column contains search. Requires a provider that supports it (see SupportsFullText).

public bool contains<T>(T? column, string? search)

Parameters

column T
search string

Returns

bool

Type Parameters

T

corr<TY, TX>(TY?, TX?)

corr(Y, X): the correlation coefficient of a set of (Y, X) pairs.

public double? corr<TY, TX>(TY? y, TX? x)

Parameters

y TY
x TX

Returns

double?

Type Parameters

TY
TX

cot(double?)

cot(x): the cotangent of value (in radians). PostgreSQL, SQL Server and MySQL/MariaDB have a native cot; ClickHouse and SQLite do not, and reject the call. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public double? cot(double? value)

Parameters

value double?

Returns

double?

count(Expression<Func<bool>>)

Filtered count(*). Requires a provider that can filter an aggregate (see AggregateFilterStyle): the ANSI filter (where ...) clause or, on ClickHouse, the -If combinator (countIf(...)). PostgreSQL, SQLite and ClickHouse opt in.

public int count(Expression<Func<bool>> filter)

Parameters

filter Expression<Func<bool>>

Returns

int

count(params object?[])

count aggregate. With no arguments it is count(*); with arguments it counts the rows whose listed expression(s) are non-null. Only SQLite renders a bare count(); other providers require an argument or the filtered overload.

public int count(params object?[] properties)

Parameters

properties object[]

The expressions to count, or an empty array for count(*).

Returns

int

count_big(Expression<Func<bool>>)

Filtered 64-bit count(*) (count_big ... filter (where ...), or the ClickHouse countIf).

public long count_big(Expression<Func<bool>> filter)

Parameters

filter Expression<Func<bool>>

Returns

long

count_big(params object?[])

64-bit count (count_big on SQL Server).

public long count_big(params object?[] properties)

Parameters

properties object[]

The expressions to count, or an empty array for count(*).

Returns

long

count_big_distinct(params object?[])

64-bit count(distinct ...) (count_big(distinct ...) on SQL Server).

public long count_big_distinct(params object?[] properties)

Parameters

properties object[]

The expressions whose distinct values are counted.

Returns

long

count_distinct(params object?[])

count(distinct ...): the number of distinct non-null values of the listed expression(s).

public int count_distinct(params object?[] properties)

Parameters

properties object[]

The expressions whose distinct values are counted.

Returns

int

count_over()

Windowed count(*).

public WindowFunction<int> count_over()

Returns

WindowFunction<int>

count_over<T>(T?)

Windowed count(property).

public WindowFunction<int> count_over<T>(T? property)

Parameters

property T

Returns

WindowFunction<int>

Type Parameters

T

covar_pop<TY, TX>(TY?, TX?)

covar_pop(Y, X): the population covariance.

public double? covar_pop<TY, TX>(TY? y, TX? x)

Parameters

y TY
x TX

Returns

double?

Type Parameters

TY
TX

covar_samp<TY, TX>(TY?, TX?)

covar_samp(Y, X): the sample covariance.

public double? covar_samp<TY, TX>(TY? y, TX? x)

Parameters

y TY
x TX

Returns

double?

Type Parameters

TY
TX

crypt_gen_random(int?)

crypt_gen_random(length): a cryptographically strong random byte string of length bytes. The portable domain is 1–1024 bytes; a constant length outside it is rejected before any SQL is emitted (ArgumentOutOfRangeException). A NULL argument yields SQL NULL. Requires a provider that supports it (see SupportsCryptGenRandom and MakeCryptGenRandom(string)); PostgreSQL additionally requires the pgcrypto extension to be installed on the server.

public byte[]? crypt_gen_random(int? length)

Parameters

length int?

Returns

byte[]

cume_dist()

Cumulative distribution of the current row within the partition, in (0, 1].

public WindowFunction<double> cume_dist()

Returns

WindowFunction<double>

current_database()

The current database name (current_database()). Requires a provider that supports it (see SessionInfoFunctions and Supports(string)).

public string? current_database()

Returns

string

current_schema()

The current schema (current_schema). Requires a provider that supports it (see SessionInfoFunctions and Supports(string)).

public string? current_schema()

Returns

string

current_user()

The name of the current user (current_user). Requires a provider that supports it (see SessionInfoFunctions and Supports(string)).

public string? current_user()

Returns

string

date_add(string, int, DateTime?)

dateadd(field, amount, value): adds amount units of field (for example "day") to a date/time. The field must be a constant string. Requires a provider that supports it (see SupportsDateArithmetic).

public DateTime? date_add(string field, int amount, DateTime? value)

Parameters

field string
amount int
value DateTime?

Returns

DateTime?

date_diff(string, DateTime?, DateTime?)

datediff(field, start, end): the number of field boundaries between two timestamps (SQL Server semantics; a provider without a native datediff may count whole units instead, which can differ). The field must be a constant string and cannot be decade/century/millennium, which T-SQL datediff has no part for. The result is 32-bit, so the span must fit int; use date_diff_big(string, DateTime?, DateTime?) for wider spans. Requires a provider that supports it (see SupportsDateArithmetic).

public int? date_diff(string field, DateTime? start, DateTime? end)

Parameters

field string
start DateTime?
end DateTime?

Returns

int?

date_diff_big(string, DateTime?, DateTime?)

datediff_big(field, start, end): like date_diff(string, DateTime?, DateTime?), but the difference is returned as a 64-bit value so a millisecond/microsecond span over a long range does not overflow the 32-bit date_diff. The field must be a constant string. Requires a provider that supports it (see SupportsDateArithmetic).

public long? date_diff_big(string field, DateTime? start, DateTime? end)

Parameters

field string
start DateTime?
end DateTime?

Returns

long?

date_from_parts(int, int, int)

datefromparts(year, month, day): builds a date from its numeric parts. Requires a provider that supports it (see SupportsDateArithmetic).

public DateTime? date_from_parts(int year, int month, int day)

Parameters

year int
month int
day int

Returns

DateTime?

date_part(string, DateTime?)

date_part(part, value): the numeric part of a date/time. Currently supports epoch (the number of seconds since 1970-01-01 00:00:00). Providers whose native timestamp type carries sub-second precision include the fraction; ClickHouse's DateTime is second-precision, so there the value is a whole number of seconds. The part must be a constant string. Use extract(string, DateTime?) for the integer parts. Requires a provider that supports the part (see SupportsDatePart(string)).

public double? date_part(string part, DateTime? value)

Parameters

part string
value DateTime?

Returns

double?

Remarks

This is not PostgreSQL's general date_part synonym: only the numeric-valued part epoch is provided here, while the integer parts (including PostgreSQL's date_part('year', x)) go through extract(string, DateTime?).

date_trunc(string, DateTime?)

date_trunc(field, value): truncates a timestamp to field (for example "month"). Requires a provider that supports it (see SupportsDateTrunc).

public DateTime? date_trunc(string field, DateTime? value)

Parameters

field string
value DateTime?

Returns

DateTime?

degrees(double?)

degrees(x): converts value from radians to degrees. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public double? degrees(double? value)

Parameters

value double?

Returns

double?

dense_rank()

Rank without gaps within the window partition.

public WindowFunction<int> dense_rank()

Returns

WindowFunction<int>

desc(Expression<Func<object?>>)

Order key of a window specification rendered as desc.

public WindowOrder desc(Expression<Func<object?>> expression)

Parameters

expression Expression<Func<object>>

Returns

WindowOrder

end_of_month(DateTime?)

eomonth(value): the last day of the month of value. Requires a provider that supports it (see SupportsDateArithmetic).

public DateTime? end_of_month(DateTime? value)

Parameters

value DateTime?

Returns

DateTime?

exists(QueryCommand)

exists(subquery): true when the correlated subquery returns at least one row. ANSI and portable across every provider.

public bool exists(QueryCommand cmd)

Parameters

cmd QueryCommand

The correlated subquery.

Returns

bool

extract(string, DateTime?)

extract(part, value): the integer part of a date/time. Supports year, quarter, month, week (ISO 8601), day, doy, dow (0=Sunday..6=Saturday), isodow (1=Monday..7=Sunday), hour, minute and second. The part must be a constant string. Use date_part(string, DateTime?) for epoch. Requires a provider that supports the part (see SupportsDatePart(string)).

public int? extract(string part, DateTime? value)

Parameters

part string
value DateTime?

Returns

int?

first_value<T>(T?)

First value of property in the window frame.

public WindowFunction<T?> first_value<T>(T? property)

Parameters

property T

Returns

WindowFunction<T>

Type Parameters

T

freetext<T>(T?, string?)

freetext(column, search): true when the full-text-indexed column matches the meaning (not just the words) of search. Requires a provider that supports it (see SupportsFullText).

public bool freetext<T>(T? column, string? search)

Parameters

column T
search string

Returns

bool

Type Parameters

T

gen_random_uuid()

Generates a random UUID v4 (gen_random_uuid()). Requires a provider that supports it (see UuidGenerators and Supports(string)): PostgreSQL 13+, SQL Server (newid()), MariaDB 11.7+ (uuid_v4()) and ClickHouse (generateUUIDv4()). An unversioned MariaDB dialect rejects it: MariaDB 11.4 has no UUID_V4() and UUID() (v1) is not substituted.

public Guid? gen_random_uuid()

Returns

Guid?

greatest<T>(params T?[])

greatest(...): the largest of the arguments. NULL handling is provider-specific: PostgreSQL, SQL Server 2022+ and ClickHouse 24.12+ ignore NULL arguments, while MySQL/MariaDB and SQLite return NULL when any argument is NULL. Requires a provider that supports it (see SupportsGreatestLeast).

public T? greatest<T>(params T?[] values)

Parameters

values T[]

Returns

T

Type Parameters

T

iif<TResult>(bool, TResult?, TResult?)

iif(condition, whenTrue, whenFalse): the conditional expression, rendered as iif (SQL Server, SQLite), if (MySQL/MariaDB, ClickHouse) or case when ... then ... else ... end (PostgreSQL). Requires a provider that supports it (see Iif).

public TResult? iif<TResult>(bool condition, TResult? whenTrue, TResult? whenFalse)

Parameters

condition bool
whenTrue TResult
whenFalse TResult

Returns

TResult

Type Parameters

TResult

in<T>(T, QueryCommand<T>)

column in (subquery): true when column equals a value returned by the correlated subquery.

public bool @in<T>(T column, QueryCommand<T> cmd)

Parameters

column T

The value to test.

cmd QueryCommand<T>

The subquery producing candidate values.

Returns

bool

Type Parameters

T

The compared value type.

in<T>(T, IEnumerable<T>)

column in (values): true when column equals one of the in-memory values.

public bool @in<T>(T column, IEnumerable<T> values)

Parameters

column T

The value to test.

values IEnumerable<T>

The candidate values.

Returns

bool

Type Parameters

T

The compared value type.

in<T>(T, params T[])

column in (v0, v1, ...): true when column equals one of the listed values.

public bool @in<T>(T column, params T[] values)

Parameters

column T

The value to test.

values T[]

The candidate values.

Returns

bool

Type Parameters

T

The compared value type.

inet_client_addr()

The IP address of the client, rendered as text (CAST(inet_client_addr() AS text)). The value is SQL NULL on a unix-socket connection, so the result is nullable. Requires a provider that supports it (see SessionInfoFunctions; PostgreSQL).

public string? inet_client_addr()

Returns

string

inet_client_port()

The TCP port the client is connected from (inet_client_port()). The value is SQL NULL on a unix-socket connection. Requires a provider that supports it (see SessionInfoFunctions; PostgreSQL).

public int? inet_client_port()

Returns

int?

inet_server_addr()

The IP address of the server the client is connected to, rendered as text (CAST(inet_server_addr() AS text)). The value is SQL NULL on a unix-socket connection, so the result is nullable. Requires a provider that supports it (see SessionInfoFunctions; PostgreSQL).

public string? inet_server_addr()

Returns

string

inet_server_port()

The TCP port of the server the client is connected to (inet_server_port()). The value is SQL NULL on a unix-socket connection. Requires a provider that supports it (see SessionInfoFunctions; PostgreSQL).

public int? inet_server_port()

Returns

int?

is_distinct_from<T>(T, T)

left is distinct from right: the complement of is_not_distinct_from<T>(T, T). Two non-NULL operands compare with ordinary inequality, and a NULL on exactly one side compares unequal instead of yielding SQL NULL/UNKNOWN. Requires a provider that supports null-safe comparison (see NullSafeComparison).

public bool is_distinct_from<T>(T left, T right)

Parameters

left T

The left operand.

right T

The right operand.

Returns

bool

The two-valued comparison result.

Type Parameters

T

The common operand type; a nullable column uses the nullable type.

is_not_distinct_from<T>(T, T)

left is not distinct from right: two-valued null-safe equality. Both NULL operands compare equal, exactly one NULL operand compares unequal, and two non-NULL operands compare with ordinary equality. Unlike ==, the result is never SQL NULL/UNKNOWN. Requires a provider that supports null-safe comparison (see NullSafeComparison); the provider may render it natively or emulate it.

public bool is_not_distinct_from<T>(T left, T right)

Parameters

left T

The left operand.

right T

The right operand.

Returns

bool

The two-valued comparison result.

Type Parameters

T

The common operand type; a nullable column uses the nullable type.

lag<T>(T?)

Value of property from the previous row (offset 1).

public WindowFunction<T?> lag<T>(T? property)

Parameters

property T

Returns

WindowFunction<T>

Type Parameters

T

lag<T>(T?, int)

Value of property from the row offset rows back.

public WindowFunction<T?> lag<T>(T? property, int offset)

Parameters

property T
offset int

Returns

WindowFunction<T>

Type Parameters

T

lag<T>(T?, int, T?)

Value of property from the row offset rows back, or defaultValue.

public WindowFunction<T?> lag<T>(T? property, int offset, T? defaultValue)

Parameters

property T
offset int
defaultValue T

Returns

WindowFunction<T>

Type Parameters

T

last_value<T>(T?)

Last value of property in the window frame.

public WindowFunction<T?> last_value<T>(T? property)

Parameters

property T

Returns

WindowFunction<T>

Type Parameters

T

lead<T>(T?)

Value of property from the next row (offset 1).

public WindowFunction<T?> lead<T>(T? property)

Parameters

property T

Returns

WindowFunction<T>

Type Parameters

T

lead<T>(T?, int)

Value of property from the row offset rows ahead.

public WindowFunction<T?> lead<T>(T? property, int offset)

Parameters

property T
offset int

Returns

WindowFunction<T>

Type Parameters

T

lead<T>(T?, int, T?)

Value of property from the row offset rows ahead, or defaultValue.

public WindowFunction<T?> lead<T>(T? property, int offset, T? defaultValue)

Parameters

property T
offset int
defaultValue T

Returns

WindowFunction<T>

Type Parameters

T

least<T>(params T?[])

least(...): the smallest of the arguments. NULL handling is provider-specific: PostgreSQL, SQL Server 2022+ and ClickHouse 24.12+ ignore NULL arguments, while MySQL/MariaDB and SQLite return NULL when any argument is NULL. Requires a provider that supports it (see SupportsGreatestLeast).

public T? least<T>(params T?[] values)

Parameters

values T[]

Returns

T

Type Parameters

T

left(string?, int)

left(value, n): the first n characters of value. PostgreSQL treats a negative n as "all but the last |n| characters"; the other providers do not, so use a non-negative n for portable queries. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? left(string? value, int n)

Parameters

value string
n int

Returns

string

like(string?, string?)

column like pattern: SQL pattern matching where % and _ are wildcards. ANSI and portable, but case-sensitivity follows the provider's collation.

public bool like(string? column, string? pattern)

Parameters

column string

The value to test.

pattern string

The pattern to match against.

Returns

bool

like(string?, string?, string?)

column like pattern escape escapeChar: SQL pattern matching with an explicit escape character for the wildcards. ANSI and portable.

public bool like(string? column, string? pattern, string? escapeChar)

Parameters

column string

The value to test.

pattern string

The pattern to match against.

escapeChar string

The character that escapes a literal % or _.

Returns

bool

lpad(string?, int, string?)

lpad(value, length, pad): left-pads value with pad (default a single space) to length characters, truncating a longer value. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? lpad(string? value, int length, string? pad = " ")

Parameters

value string
length int
pad string

Returns

string

max_over<T>(T?)

Windowed max.

public WindowFunction<T?> max_over<T>(T? property)

Parameters

property T

Returns

WindowFunction<T>

Type Parameters

T

max<T>(T?)

max aggregate: the largest non-null value of property.

public T? max<T>(T? property)

Parameters

property T

The value to aggregate.

Returns

T

Type Parameters

T

The value type.

max<T>(T?, Expression<Func<bool>>)

Filtered max(property) (the ANSI filter (where ...) clause or the ClickHouse maxIf).

public T? max<T>(T? property, Expression<Func<bool>> filter)

Parameters

property T
filter Expression<Func<bool>>

Returns

T

Type Parameters

T

min_over<T>(T?)

Windowed min.

public WindowFunction<T?> min_over<T>(T? property)

Parameters

property T

Returns

WindowFunction<T>

Type Parameters

T

min<T>(T?)

min aggregate: the smallest non-null value of property.

public T? min<T>(T? property)

Parameters

property T

The value to aggregate.

Returns

T

Type Parameters

T

The value type.

min<T>(T?, Expression<Func<bool>>)

Filtered min(property) (the ANSI filter (where ...) clause or the ClickHouse minIf).

public T? min<T>(T? property, Expression<Func<bool>> filter)

Parameters

property T
filter Expression<Func<bool>>

Returns

T

Type Parameters

T

nth_value<T>(T?, int)

nth_value(property, n): the value of property at the 1-based n-th row of the window frame. Requires a provider that supports it (see SupportsNthValue); SQL Server has no NTH_VALUE.

public WindowFunction<T?> nth_value<T>(T? property, int n)

Parameters

property T
n int

Returns

WindowFunction<T>

Type Parameters

T

ntile(int)

Splits the partition into buckets roughly equal groups.

public WindowFunction<int> ntile(int buckets)

Parameters

buckets int

Returns

WindowFunction<int>

nullif<T>(T?, T?)

nullif(value, other): null when the two arguments are equal. ANSI and portable.

public T? nullif<T>(T? value, T? other)

Parameters

value T
other T

Returns

T

Type Parameters

T

octet_length(string?)

octet_length(value): the number of octets (bytes) in the encoded value. Requires a provider that supports it (see ScalarFunctions and Supports(string)); SQLite requires 3.43+ for its native octet_length().

public int? octet_length(string? value)

Parameters

value string

Returns

int?

percent_rank()

Relative rank of the current row: (rank - 1) / (rows - 1), in [0, 1].

public WindowFunction<double> percent_rank()

Returns

WindowFunction<double>

percentile_cont<T>(double, T?)

Windowed percentile_cont(fraction): the interpolated value at fraction in the window. Rendered as percentile_cont(fraction) within group (order by value) over (...); requires a provider that supports the window percentile form (see SupportsPercentileWindow; SQL Server and MariaDB). PostgreSQL expresses percentiles as an ordered-set aggregate instead (percentile_cont<T>(double, Expression<Func<T>>)), which is not a window function.

public WindowFunction<T?> percentile_cont<T>(double fraction, T? value)

Parameters

fraction double
value T

Returns

WindowFunction<T>

Type Parameters

T

percentile_disc<T>(double, T?)

Windowed percentile_disc(fraction): the first value whose position reaches the fraction.

public WindowFunction<T?> percentile_disc<T>(double fraction, T? value)

Parameters

fraction double
value T

Returns

WindowFunction<T>

Type Parameters

T

pg_backend_pid()

The server-side backend process id (pg_backend_pid()). Requires a provider that supports it (see SessionInfoFunctions and Supports(string); PostgreSQL).

public int pg_backend_pid()

Returns

int

pi()

pi(): the constant π. Requires a provider that supports it (see ScalarFunctions and Supports(string)); the trigonometric Math.Acos/Asin/Atan/Atan2 are reachable directly.

public double? pi()

Returns

double?

radians(double?)

radians(x): converts value from degrees to radians. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public double? radians(double? value)

Parameters

value double?

Returns

double?

rank()

Rank with gaps within the window partition.

public WindowFunction<int> rank()

Returns

WindowFunction<int>

repeat(string?, int)

repeat(value, count): value repeated count times. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? repeat(string? value, int count)

Parameters

value string
count int

Returns

string

reverse(string?)

reverse(value): the characters of value in reverse order. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? reverse(string? value)

Parameters

value string

Returns

string

right(string?, int)

right(value, n): the last n characters of value. PostgreSQL treats a negative n as "all but the first |n| characters"; the other providers do not, so use a non-negative n for portable queries. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? right(string? value, int n)

Parameters

value string
n int

Returns

string

row_number()

Sequential row number within the window partition.

public WindowFunction<int> row_number()

Returns

WindowFunction<int>

rpad(string?, int, string?)

rpad(value, length, pad): right-pads value with pad (default a single space) to length characters, truncating a longer value. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? rpad(string? value, int length, string? pad = " ")

Parameters

value string
length int
pad string

Returns

string

session_user()

The name of the session user (session_user). Requires a provider that supports it (see SessionInfoFunctions and Supports(string)).

public string? session_user()

Returns

string

space(int)

space(count): a string of count spaces. Requires a provider that supports it (see ScalarFunctions and Supports(string)).

public string? space(int count)

Parameters

count int

Returns

string

stdev_distinct<T>(T?)

stdev(distinct ...) aggregate: the sample standard deviation of the distinct non-null values; a nullable input is accepted and null values are ignored.

public T? stdev_distinct<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

stdev_distinct<T>(T)

stdev(distinct ...) aggregate: the sample standard deviation of the distinct non-null values.

public T? stdev_distinct<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

stdev<T>(T?)

stdev aggregate: the sample standard deviation of the non-null values; a nullable input is accepted and null values are ignored.

public T? stdev<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

stdev<T>(T)

stdev aggregate: the sample standard deviation of the non-null values.

public T? stdev<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

stdevp_distinct<T>(T?)

stdevp(distinct ...) aggregate: the population standard deviation of the distinct non-null values; a nullable input is accepted and null values are ignored.

public T? stdevp_distinct<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

stdevp_distinct<T>(T)

stdevp(distinct ...) aggregate: the population standard deviation of the distinct non-null values.

public T? stdevp_distinct<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

stdevp<T>(T?)

stdevp aggregate: the population standard deviation of the non-null values; a nullable input is accepted and null values are ignored.

public T? stdevp<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

stdevp<T>(T)

stdevp aggregate: the population standard deviation of the non-null values.

public T? stdevp<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

string_agg<T>(T?, string)

string_agg(value, delimiter): concatenates the values of a group. Requires a provider that supports it (see SupportsStringArrayAggregates).

public string? string_agg<T>(T? value, string delimiter)

Parameters

value T
delimiter string

Returns

string

Type Parameters

T

string_agg<T>(T?, string, Expression<Func<bool>>)

Filtered string_agg(value, delimiter) filter (where ...).

public string? string_agg<T>(T? value, string delimiter, Expression<Func<bool>> filter)

Parameters

value T
delimiter string
filter Expression<Func<bool>>

Returns

string

Type Parameters

T

sum_distinct<T>(T?)

sum(distinct ...): the sum of the distinct non-null values.

public T? sum_distinct<T>(T? property)

Parameters

property T

The value to aggregate.

Returns

T

Type Parameters

T

The value type.

sum_over<T>(T?)

Windowed sum. The _over suffix avoids clashing with the scalar aggregate.

public WindowFunction<T?> sum_over<T>(T? property)

Parameters

property T

Returns

WindowFunction<T>

Type Parameters

T

sum<T>(T?)

sum aggregate: the sum of the non-null values.

public T? sum<T>(T? property)

Parameters

property T

The value to aggregate.

Returns

T

Type Parameters

T

The value type.

sum<T>(T?, Expression<Func<bool>>)

Filtered sum(property) (the ANSI filter (where ...) clause or the ClickHouse sumIf).

public T? sum<T>(T? property, Expression<Func<bool>> filter)

Parameters

property T
filter Expression<Func<bool>>

Returns

T

Type Parameters

T

translate(string?, string?, string?)

translate(value, from, to): replaces every character of from in value with the character at the same position of to; a character of from beyond the length of to is deleted. Requires a provider that supports it (see ScalarFunctions and Supports(string)); MySQL and MariaDB have no translate and reject it.

public string? translate(string? value, string? from, string? to)

Parameters

value string
from string
to string

Returns

string

user()

The connecting account as the server reports it (USER()), surfaced by MySQL/MariaDB: the user@host pair of the client, which is not the effective authenticated account (current_user()) and is client-influenced. Requires a provider that supports it (see SessionInfoFunctions; MySQL/MariaDB).

public string user()

Returns

string

uuidv7()

Generates a UUID v7 (uuidv7()). Requires a provider that supports it (see UuidGenerators and Supports(string)): PostgreSQL 18+, MariaDB 11.7+ (uuid_v7()) and ClickHouse (generateUUIDv7()). PostgreSQL renders it only when the dialect is configured with an explicit server version 18 or later; a version below 18 and an unset version refuse at preparation with NotSupportedException, and no v4 generator or null is substituted. An unversioned MariaDB dialect rejects it.

public Guid? uuidv7()

Returns

Guid?

var_distinct<T>(T?)

var(distinct ...) aggregate: the sample variance of the distinct non-null values; a nullable input is accepted and null values are ignored.

public T? var_distinct<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

var_distinct<T>(T)

var(distinct ...) aggregate: the sample variance of the distinct non-null values.

public T? var_distinct<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

var<T>(T?)

var aggregate: the sample variance of the non-null values; a nullable input is accepted and null values are ignored.

public T? var<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

var<T>(T)

var aggregate: the sample variance of the non-null values.

public T? var<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

varp_distinct<T>(T?)

varp(distinct ...) aggregate: the population variance of the distinct non-null values; a nullable input is accepted and null values are ignored.

public T? varp_distinct<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

varp_distinct<T>(T)

varp(distinct ...) aggregate: the population variance of the distinct non-null values.

public T? varp_distinct<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

varp<T>(T?)

varp aggregate: the population variance of the non-null values; a nullable input is accepted and null values are ignored.

public T? varp<T>(T? property) where T : struct

Parameters

property T?

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

varp<T>(T)

varp aggregate: the population variance of the non-null values.

public T? varp<T>(T property) where T : struct

Parameters

property T

The value to aggregate.

Returns

T?

Type Parameters

T

The value type.

version()

The provider version string (version()). Requires a provider that supports it (see SessionInfoFunctions and Supports(string)).

public string? version()

Returns

string