When there is a clustered index on the table and the column to be queried, both the
MAX()operator and the query
SELECT TOP 1will have almost identical performance.
When there is no clustered index on the table and the column to be queried, the
MAX()operator offers the better performance.
- Inserting multiple rows in a single SQL query? [duplicate]
- Find all tables containing column with specified name – MS SQL Server
- SET NOCOUNT ON usage
- How can I group by date time column without taking time into consideration
- How do I drop a foreign key constraint only if it exists in sql server?
- How to update Identity Column in SQL Server?
- Use variable with TOP in select statement in SQL Server without making it dynamic [duplicate]
- is it possible to select EXISTS directly as a bit?
- Most efficient T-SQL way to pad a varchar on the left to a certain length?
- Multi-statement Table Valued Function vs Inline Table Valued Function
- How to check existence of user-define table type in SQL Server 2008?
- Imply bit with constant 1 or 0 in SQL Server
- IndexOf function in T-SQL
- TSQL Pivot without aggregate function
- Reference alias (calculated in SELECT) in WHERE clause
- What is SYSNAME data type in SQL Server?
- Unpivot with column name
- SQL Server 2008: How to query all databases sizes?
- varbinary to string on SQL Server
- How to group by month from Date field using sql
- Partition Function COUNT() OVER possible using DISTINCT
- INSERT vs INSERT INTO
- How to rethrow the same exception in SQL Server
- How can I include null values in a MIN or MAX?
- How to compare datetime with only date in SQL Server
- Should every SQL Server foreign key have a matching index? [closed]
- What do you do in SQL Server to CREATE OR ALTER?
- TSQL DATETIME ISO 8601
- Can I loop through a table variable in T-SQL?
- Passing a varchar full of comma delimited values to a SQL Server IN function
- Get MAX value of a BIT column
- Column name or number of supplied values does not match table definition
- Get Multiple Values in SQL Server Cursor
- SQL Server – How to lock a table until a stored procedure finishes
- SQL – How do I get only the numbers after the decimal?
- Unique key vs. unique index on SQL Server 2008
- Know relationships between all the tables of database in SQL Server
- SQL Server check case-sensitivity?
- SQL Server equivalent to Oracle’s NULLS FIRST?
- T-SQL Conditional Order By
- Duplicating a TABLE using Microsoft SQL Server Management
- SQL: Combine Select count(*) from multiple tables
- Multiple FULL OUTER JOIN on multiple tables
- How to check if cursor exists (open status)
- What are the differences between T-SQL, SQL Server and SQL [duplicate]
- SQL – Call Stored Procedure for each record
- How to return multiple values in one column (T-SQL)?
- Control flow in T-SQL SP using IF..ELSE IF – are there other ways?
- How do I grant read access for a user to a database in SQL Server?
- Which is better: Bookmark/Key Lookup or Index Seek