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 / rajkumar v

select SNo, '(' + convert(varchar,count(SNo)) + ')' from
test group by SNo having COUNT(*)>=1

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where is localdb stored?

742


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

667


Can you edit the .rdl code associated with a linked report?

121


What does the not null constraint do?

766


Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?

734


Explain about SQL server 2005?

761


What are blobs, tables, and Queues? Is SQL is the standard way to query blobs, tables, and queues?

131


Explain the microsoft sql server delete command? : SQL Server Architecture

790


explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

825


Can you please explain the difference between primary keys and foreign keys?

863


What is the chart in report?

125


Explain left outer join and right outer join?

777


What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?

681


What do you mean by normalisation?

692


Explain where clause?

751