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 / madhu sudhan g

Hiiiii

Lets the table name is No1 having column A is of int data Type
Now the query is
select convert(nvarchar(5),A) + '(' +
convert(nvarchar(5),count(1))+')' from NO1 GROUP BY A

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I completely remove sql server instance?

805


How do I view a procedure in sql server?

771


List out a number of the wants to setup a SQL Server failover cluster?

774


What stored by the model? : sql server database administration

726


what method you can use to reduce the overhead of Reporting Services data sources?

208


What are the two modes of authentication in sql server?

711


What is data modification?

718


What is the tcp/ip port on which sql server runs?

776


Can a table be created inside a trigger?

744


Explain what is use of dbcc commands?

735


what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration

814


Why main is user defined function?

778


Which Model uses the SET concept

761


Can coalesce return null?

753


Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?

775