Tag Archives: SQL Functions

RIGHT() function in SQL Server

SQL Server – RIGHT ()¬†function Right():- This function returns the specified number of characters from the Right part of the given character string. Syntax:- Select RIGHT ( character_expression , integer_expression ) For example, the below query will return two characters … Continue reading

Posted in SQL Basic, SQL Functions, SQL Server | Tagged | 30 Comments

LEFT() function in SQL Server

LEFT() function in SQL Server Left() Function ¬†This function returns the specified number of characters from the left part of the given character string. Syntax Select LEFT ( character_expression , integer_expression )For example, the below query will return two characters … Continue reading

Posted in SQL Basic, SQL Functions, SQL Server | Tagged | 31 Comments

Between function in SQL Server

Between function in SQL Server This function is used to select the values within a specified range. These values can be of Int type or Date data type or Text data type. Syntax:- SELECT column_name(s) FROM table_name WHERE column_name BETWEEN … Continue reading

Posted in SQL Basic, SQL Functions, SQL Server | Tagged | Leave a comment

IN clause in SQL Server

With IN clause, we can specify multiple values in a WHERE clause. For example, in case of “IN”, one can use the subquery to get the multiple values in the IN clause or we can have predefined values. In this … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , | 32 Comments

UPPER() function in SQL Server

UPPER():- This function is used to convert the value of a column to upper case.  Syntax:    SELECT UPPER(string) OR Select UPPER(Column name) from tablename For example,   SELECT UPPER(‘Vivek’) Result:    VIVEK

Posted in SQL Functions, SQL Server | Tagged | 30 Comments

AVG() function in SQL Server

Avg():- This function is used to get the average value of a numeric column Syntax:-       SELECT AVG(column_name) FROM table_name In this article, we are going to use the following table for some examples:- CREATE TABLE [dbo]. [Employee]( [Empid] [Int] … Continue reading

Posted in SQL Functions, SQL Server | Tagged | 29 Comments

LOWER() function in SQL Server

LOWER():- This function is used to convert the value of a column to lower case  Syntax:-  Select LOWER (string)    or    SELECT LOWER(column_name) FROM table_name For example, SELECT LOWER(‘Vivek Johari’) Result:- vivek johari

Posted in SQL Functions, SQL Server | Tagged | Leave a comment

LEN() function in SQL Server

LEN():- This function is used to get the length of the given string value.   Syntax:-     Select len (stringvalue)   For example,     Select len(‘Vivek Johari’)    Result:-    12

Posted in SQL Functions, SQL Server | Tagged | Leave a comment

Substring() function in SQL Server

Substring():- This function is used to return the specified number (third argument “len”) of characters from a given string(first argument) from the start position as specified as the second argument. Syntax:-    Select  SUBSTRING ( expression ,start , length ) … Continue reading

Posted in SQL Functions, SQL Server | Tagged | 31 Comments

LTRIM() function in SQL Server

LTRIM ():- This function is used to get the string after the removal of leading blank spaces. Syntax:- LTRIM ( character_expression ) For example:- Select LTRIM  (‘  Vivek Johari’) Result:- Vivek Johari (without blank spaces on left side)

Posted in SQL Functions, SQL Server | Tagged | 21 Comments