In SQL Server, we can use the T-SQL LTRIM()
function to remove leading blanks from a given string.
Also, as from SQL Server 2022, we can specify other leading characters to remove from the string.
Continue readingIn SQL Server, we can use the T-SQL LTRIM()
function to remove leading blanks from a given string.
Also, as from SQL Server 2022, we can specify other leading characters to remove from the string.
Continue readingIn SQL Server STRING_SPLIT()
is a table-valued function that splits a string into rows of substrings, based on a specified separator character.
Each substring is returned on its own row, in a column called value
.
In SQL Server the CHOOSE()
function returns the item at the specified index from a list of values.
The SQL COUNT()
function is a handy tool for telling us how many rows would be returned in a query. We can pass a column name to the function or we can pass the asterisk (*
) wildcard to indicate all columns.
If a column contains NULL values, we could get different results, depending on whether we use the column name or the asterisk (*
).
SQL Server 2022 introduced the LEAST()
function, which at first glance, may seem to do the same thing as the already existing MIN()
function.
However, these are two separate functions with two separate purposes.
Continue readingIn SQL Server the VARP()
function returns the statistical variance for the population for all values in the specified expression.
In SQL Server the VAR()
function returns the statistical variance of all values in the specified expression.
In SQL Server the STDEVP()
function returns the statistical standard deviation for the population for all values in the specified expression.
In SQL Server the STDEV()
function returns the statistical standard deviation of all values in a specified expression.
So we can use this function to get the standard deviation of all values in a column.
Continue readingSQL Server has a GROUPING_ID()
function that returns the level of grouping based on its arguments.
We pass one or more column expressions to the function, and it computes the level of grouping. The column expressions must match the ones provided by the GROUP BY
clause.