adspace


what is the difference between count(*) and count(1) ?

Answer Posted / Brijesh Kumar Singh

In SQL Server, both count(*) and count(1) return the number of rows in a result set. However, there's a slight performance difference: count(*) performs better because it doesn't require an expression to be evaluated for each row, whereas count(1) does. This means count(1) will perform a small amount of calculation on every row, making it slightly slower compared to count(*).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Equi join and non equi join is possible with sql server?

1134


what is the difference between openrowset and openquery?

1194


What are the source of constraints?

1009


What are the properties of the transaction?

1073


How to convert character strings into numeric values?

1190


Can you index views?

954


Why we use the openxml clause?

1079


What is a scheduled job or what is a scheduled task?

1039


What is sql or structured query language?

1227


What is clustered index

1086


How can we solve concurrency problems?

1122


List out the different types of locks available in sql server?

1050


What is the primary use of the model database?

1149


What is a view in sql?

1040


Can we shrink data file in sql server?

1128