Skip to content

Database.Guide

functions

How TRY_CAST() Works in SQL Server

December 18, 2021 by Ian

In SQL Server, an often used function is CAST(), which converts an expression of one data type to another. But if the cast doesn’t succeed, then it returns an error.

Enter TRY_CAST().

The TRY_CAST() function doesn’t return an error if the cast fails. Instead, it returns NULL.

There are some occasions however, where it will return an error.

Read more

Categories SQL Server Tags conversion functions, functions, how to, t-sql

How TRY_CONVERT() Works in SQL Server

December 18, 2021 by Ian

In SQL Server, the TRY_CONVERT() function is very similar to the CONVERT() function, except that TRY_CONVERT() doesn’t return an error if the conversion fails (CONVERT() does).

Instead, the TRY_CONVERT() function returns NULL if the conversion doesn’t succeed.

There are some occasions however, where TRY_CONVERT() will return an error.

Read more

Categories SQL Server Tags conversion functions, functions, t-sql, what is

CONVERT() in SQL Server

January 24, 2023December 17, 2021 by Ian

In SQL Server, the CONVERT() function converts an expression of one data type to another.

Here’s a quick overview of the function with examples.

Read more

Categories SQL Server Tags conversion functions, functions, t-sql, what is

How CAST() Works in SQL Server

December 18, 2021December 17, 2021 by Ian

In SQL Server, the CAST() function converts an expression of one data type to another.

Here’s a quick overview of the function with examples.

Read more

Categories SQL Server Tags conversion functions, functions, t-sql, what is

MAX() Function in PostgreSQL

December 14, 2021 by Ian

In PostgreSQL, the MAX() function computes the maximum of the non-null input values and returns the result.

This function can be used on any numeric, string, date/time, or enum type, as well as inet, interval, money, oid, pg_lsn, tid, and arrays of any of these types.

Read more

Categories PostgreSQL Tags aggregate functions, aggregation, functions, what is

MIN() Function in PostgreSQL

December 14, 2021 by Ian

In PostgreSQL, the MIN() function computes the minimum of the non-null input values and returns the result.

This function can be used on any numeric, string, date/time, or enum type, as well as inet, interval, money, oid, pg_lsn, tid, and arrays of any of these types.

Read more

Categories PostgreSQL Tags aggregate functions, aggregation, functions, what is

DATABASE() – Get the Current Database Name in MySQL

December 12, 2021 by Ian

In MySQL, DATABASE() is a built-in function that returns the default (current) database name.

The result is returned as a string in the utf8 character set. If there is no default database, it returns NULL.

Read more

Categories MySQL Tags functions, what is

SUM() Function in MySQL

July 21, 2023December 10, 2021 by Ian

In MySQL, the SUM() aggregate function returns the sum of a given expression.

It can also be used to return the sum of all distinct (unique) values in an expression.

Read more

Categories MySQL Tags aggregate functions, aggregation, functions, what is, window functions

COUNT() Function in MariaDB

July 21, 2023December 5, 2021 by Ian

In MariaDB, the COUNT() aggregate function returns a count of the number of non-NULL values of an expression in the rows retrieved by a SELECT statement.

Read more

Categories MariaDB Tags aggregate functions, aggregation, functions, what is, window functions

AVG() Function in MariaDB

July 21, 2023December 4, 2021 by Ian

In MariaDB, the AVG() function returns the average value of the given expression.

The DISTINCT option can be used to return the average of the distinct values (i.e. remove duplicates before calculating the average).

NULL values are ignored.

Read more

Categories MariaDB Tags aggregate functions, aggregation, functions, what is, window functions
Older posts
Newer posts
← Previous Page1 … Page46 Page47 Page48 … Page151 Next →

About | Privacy Policy

© 2026 Database.Guide • All rights reserved