if we have a column (Key) in a table.
and values of that column is
Key
1
1
1
2
2
3
3
4
4
5
5
5
and we want to show the data after query..like..
1(3)
2(3)
3(2)
4(2)
5(3)
how many times a single term comes..
Answer Posted / rakesh prasad
In Sql server 2005
select col + '('+ cast (count(col)as varchar(1000))+')'from
tablename group by col
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are cursors stored procedures and triggers?
what's new in sql server 2016?
How do you trace the traffic hitting a sql server?
What are click through reports?
Explain the cursor lock types?
What is the synonym of join?
Explain DBCC?
How to get the query of a table in sql server?
What is default port number for sql server 2000?
Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)
What is sql server english query?
What are user-defined functions (udfs) in sql server?
Can a cursor be updated? If yes, how you can protect which columns are updated?
What is difference between equi join and inner join?
What is a file group?