SQL COUNT is the aggregate arithmetic function. COUNT allows us to COUNT number of row that matches specified criteria. This function returns the number of rows in the query. The COUNT function will only count those records in which the field in the brackets is NOT NULL. The SQL COUNT function is easy to use. [Read more…] about SQL: COUNT Function
SQL CAST() Function
All of the aforementioned functions relate to specific ways to manipulate character, date/time, or numeric datatypes. But you may need to convert data from one datatype to another or convert NULL values to something meaningful. [Read more…] about SQL CAST() Function
SQL Server ROUND() Function
The ROUND function allows you to round any numeric value. The general format is: [Read more…] about SQL Server ROUND() Function
SQL GETDATE() Function
The simplest of the date/time functions is one that returns the current date and time. In Microsoft SQL Server, the function is named GETDATE. This function has no arguments. It merely returns the current date and time. For example: [Read more…] about SQL GETDATE() Function
SQL DATEPART() Function
The simplest of the date/time functions is one that returns the current date and time. In Microsoft SQL Server, the function is named GETDATE. This function has no arguments. It merely returns the current date and time. For example: [Read more…] about SQL DATEPART() Function
SQL Server DATEDIFF() Function
The simplest of the date/time functions is one that returns the current date and time. In Microsoft SQL Server, the function is named GETDATE. This function has no arguments. It merely returns the current date and time. For example: [Read more…] about SQL Server DATEDIFF() Function
SQL: DECODE Function
The DECODE function can be thought of as an inline IF statement. DECODE takes three or more expressions as arguments. Each expression can be a column, a literal, a function, or even a subquery. Let’s look at a simple example using DECODE: [Read more…] about SQL: DECODE Function
SQL NVL Function
The NVL and NVL2 functions allow you to test an expression to see whether it is NULL. If an expression is NULL, you can return an alternate, non-NULL value, to use in its place. Since any of the expressions in a DECODE statement can be NULL, the NVL and NVL2 functions are actually specialized versions of DECODE. The following example uses NVL2 to produce the same results as the DECODE: [Read more…] about SQL NVL Function