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.
Author |
Topic |
MageshkumarM
Yak Posting Veteran
61 Posts |
Posted - 2011-02-03 : 02:22:19
|
Hi,I need one small doubt to count datas in a statement.statement:-[ select date from table1 group by datepart(year, year(date)); ]this statement will returns 10 rows.I need to count this 10 rows in single value..for ex:*******count( select date from table1 group by datepart(year, year(date));)-so, i want count is [ count = 10 ]. can anyone help me out this..MAG,Start with the new Idea..http://mageshkumarm.blogspot.com/ |
|
sohail.mahmood69
Starting Member
7 Posts |
Posted - 2011-02-03 : 02:46:07
|
Its like thisselect COUNT(date) from table1 group by datepart(year, year(date));Sohail Malik |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-03 : 03:24:35
|
select COUNT(date) as c from table1 group by datepart(year, date);orselect sum(c) as counting from(select COUNT(date) as c from table1 group by datepart(year, date)) as tMadhivananFailing to plan is Planning to fail |
|
|
MageshkumarM
Yak Posting Veteran
61 Posts |
Posted - 2011-02-03 : 03:27:45
|
ok thanks guys i got it..!MAG,Start with the new Idea..http://mageshkumarm.blogspot.com/ |
|
|
|
|
|