Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Combine Queries

Author  Topic 

engcanada
Starting Member

39 Posts

Posted - 2012-06-06 : 16:57:09
I need help combining these 2 queries:

select c1, c2 from mytable order by dateragister desc

select count(id) as total from mytable

Regards

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-06 : 16:58:09
select c1, c2, total=(select count(id) as total from mytable) from mytable order by dateragister desc

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

engcanada
Starting Member

39 Posts

Posted - 2012-06-06 : 16:59:43
Thank you for your help!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-06 : 17:01:25


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -