In PostgreSQL array_shuffle()
is a system function that randomly shuffles the first dimension of a given array.
The array_shuffle()
function was introduced in PostgreSQL 16, which was released on September 14th 2023.
In PostgreSQL array_shuffle()
is a system function that randomly shuffles the first dimension of a given array.
The array_shuffle()
function was introduced in PostgreSQL 16, which was released on September 14th 2023.
In PostgreSQL array_sample()
is a system function that returns an array of a specified number of items randomly selected from the given array.
The array_sample()
function was introduced in PostgreSQL 16, which was released on September 14th 2023.
PostgreSQL 16 introduced the date_subtract()
function that allows us to subtract an interval from a timestamp with time zone.
It computes times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone
setting if that is omitted.
PostgreSQL 16 introduced the date_add()
function that allows us to add an interval to a timestamp with time zone.
It computes times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone
setting if that is omitted.
In SQL Server, we can use the GET_BIT()
function to return the bit from the specified location in a value. We pass the value as either an integer or binary expression.
The function accepts two arguments; the expression, and the offset. The function then returns the bit from the given offset in the expression.
Continue readingIn SQL Server, the BIT_COUNT()
function returns the number of bits set to 1 in the given argument, based on the binary equivalent of that argument.
Different values will have a different number of 1s in their binary value. Also, the same value can have a different number of 1s, depending on the data type.
Continue readingSQL Server 2022 introduced the SET_BIT()
function that sets a bit in an integer or binary value (other than a large object).
The function allows us to specify an offset for which to set a bit to 1
or 0
.
In SQL Server, RIGHT_SHIFT()
is a bit manipulation function that returns the first argument bit-shifted right by the number of bits specified in the second argument.
The RIGHT_SHIFT()
function was introduced in SQL Server 2022.
In SQL Server, LEFT_SHIFT()
is a bit manipulation function that returns the first argument bit-shifted left by the number of bits specified in the second argument.
The LEFT_SHIFT()
function was introduced in SQL Server 2022.
SQL Server 2022 introduced the GREATEST()
function that returns the maximum value from a list of values. You may be thinking, “but there’s already a MAX()
function that returns the maximum value, so why the need for another function that does the same thing?”.
Well here’s the thing – they don’t do the same thing. They’re actually quite different functions, used in different scenarios.
If you’re wondering what the difference is between the MAX()
and GREATEST()
functions, read on to find out.