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


Please Help Members By Posting Answers For Below Questions

What is star, snowflake and star flake schema? : sql server analysis services, ssas

647


Why do you need a sql server?

497


What are the rendering extensions of ssrs?

105


What are the different types of sql server replication? : sql server replication

617


What is partitioned view?

515






What is row_number () and partition by in sql server?

516


Explain indexed views and partitioned view with their syntax.

675


Do you know what is bit data type and whats the information that can be stored inside a bit column?

544


Do you know what is difference between stored procedure and user defined function?

608


What are the 7 disadvantages to a manual system?

499


What is wrong with sql server client libarary dll, ntwdblib.dll?

550


What are the differences between union, intersect, and minus operators?

564


What stored by the msdb? : sql server database administration

554


Explain primary key?

534


What are scheduled tasks in sql server?

536