AND and OR Operator in Sql Server
And & Or:- These Operators are used to further filter the recordset return by SQL queries when more than one conditions...
2014-08-13
570 reads
And & Or:- These Operators are used to further filter the recordset return by SQL queries when more than one conditions...
2014-08-13
570 reads
Sum():- This function is used to get the sum of values of the specified numeric column.
Syntax:-
Select Sum (column_name) from tablename
Example:-...
2014-08-12
727 reads
Round():-This function is used to round a numeric field to the number of decimals specified.
Syntax:-
ROUND ( numeric_expression , length [ ,function ]
numeric_expression...
2014-08-12
884 reads
This function returns the distinct values from the left query that are not also found on the right query. For...
2014-08-12
783 reads
Like:- This operator is used in a WHERE clause to search for a specific pattern in the values of the...
2014-08-11
434 reads
1. All the tables in the database have properly defined relationship using primary keys and foreign keys .
2. Indexes should...
2014-08-11
2,302 reads
This function is used to select the values within a specified range. These values can be of Int type or...
2014-08-11
361 reads
Left():- This function returns the specified number of characters from the left part of the given character string.
Syntax:-
Select LEFT ( character_expression...
2014-08-11
972 reads
Right():- This function returns the specified number of characters from the Right part of the given character string.
Syntax:-
Select RIGHT ( character_expression...
2014-08-11
774 reads
This function is used to returns distinct values that are returned by both the query on the left and right...
2014-08-11
1,088 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