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
List out some of the requirements to set up a sql server failover cluster?
How do you trace the traffic hitting a sql server?
How do I find the sql server database version?
What is update locks?
What have included columns when we talk about sql server indexing?
Explain Normalization and DE normalization
What are pessimistic lock and optimistic lock?
What is the maximum size of a row in sql server?
Does table partitioning improve performance?
Do you know how to implement service broker?
What are the basic functions for master, msdb, model, tempdb databases?
Can we call stored procedure in trigger?
How to override dml statements with triggers?
How to stop log file growing too big?
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?