Link to home
Start Free TrialLog in
Avatar of JC_Lives
JC_LivesFlag for United States of America

asked on

SQL Server count function

Hi experts,

I can't tell the difference between these two selects, could you help me understand why they would behave differently?

1. select process_Step, loan_status, count(acct#) from LMDev.dbo.sd10_View_Staging group by process_step, loan_status

2. select process_Step, loan_status, count(*) from LMDev.dbo.sd10_View_Staging group by process_step, loan_status

Thanks!
Avatar of Haver Ramirez
Haver Ramirez

the first count one column, the second count the entire table
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JC_Lives

ASKER

Cool! Thanks!