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,...
2014-08-14
894 reads
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,...
2014-08-14
894 reads
UPPER():- This function is used to convert the value of a column to upper case.
Syntax:
SELECT UPPER(string)
OR
Select UPPER(Column name)...
2014-08-14
1,261 reads
LEN():- This function is used to get the length of the given string value.
Syntax:-
Select len (stringvalue)
For example,
...
2014-08-14
759 reads
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...
2014-08-14
592 reads
LTRIM ():- This function is used to get the string after the removal of leading blank spaces.
Syntax:-
LTRIM ( character_expression )
For example:-
Select LTRIM ...
2014-08-14
434 reads
Substring():- This function is used to return the specified number (third argument "len") of characters from a given string(first argument)...
2014-08-14
962 reads
Another Great meeting and topic is coming to the folks in Las Vegas. This month we have had the luck of finding Mike Fal (blog | twitter) step...
2014-08-14
11 reads
Another Great meeting and topic is coming to the folks in Las Vegas. This month we have had the luck...
2014-08-14
686 reads
I was reading a book about network security monitoring and it mentioned The Cuckoo’s Egg by Cliff Stoll. Stoll’s book has been...
2014-08-13
522 reads
You know, these 1 hour sessions that are at most SQL Saturdays are just too short sometimes – you just get...
2014-08-13
680 reads
By Steve Jones
This is timely, as I’m currently on a boat in the Adriatic taking a...
You can find the slides and SQL scripts for my session “Spice up your...
By SQLPals
How to Clear the SSMS Cache (SSMS 21 and Later) Updated...
Comments posted to this topic are about the item Using CHOOSE()
Comments posted to this topic are about the item Re-Seeding a Broken Log Shipping...
Comments posted to this topic are about the item The DBA is Dead! Long...
We have this code that sets some status values and then queries them using the CHOOSE() function in SQL Server 2025.
CREATE TABLE Status
(
StatusID INT,
StatusDescription VARCHAR(20)
);
GO
INSERT dbo.Status
(
StatusID,
StatusDescription
)
VALUES
(0, 'Uncategorized'),
(1, 'Active'),
(2, 'Inactive'),
(3, 'Temp');
GO
SELECT CHOOSE(StatusID, 'Unknown', 'Active', 'Inactive', 'Temporary')
FROM Status;
When the SELECT runs, what is returned? See possible answers