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

Define synonym?

726


Explain few examples of stored procedure over triggers?

519


Explain what are commit and rollback in sql?

528


Some queries related to SQL

586


How to download microsoft sql server 2005 express edition?

574






What is the federation in sql azure?

79


How to write a query with a left outer join in ms sql server?

572


Why I am getting "the microsoft .net framework 2.0 in not installed" message?

512


What are the different types of upgrades that can be performed in sql server?

689


You want your report to display a hyperlink that will take users to your intranet. How do you configure such a hyperlink?

243


What is a benefit of using an after insert trigger over using a before insert trigger?

512


What do we have to check in database testing?

582


What are the triggers in sql?

556


how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A

1212


What is scheduled job and how to create it?

549