Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

SQL Select with total count rows outter apply?

Weird request
I need a select * from myTable and I need a column appended that shows the total count of rows...
NOT running row number.

So if I have a select with 3 rows it would return this

ID    cnt
1        3
2        3
3        3
Avatar of Barry Cunney
Barry Cunney
Flag of Ireland image

select
t.*
,(
  Select COUNT(*) FROM myTable
) cnt
from
myTable t
ASKER CERTIFIED SOLUTION
Avatar of Barry Cunney
Barry Cunney
Flag of Ireland 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 Larry Brister

ASKER

Perfect. Thanks