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 convert(varchar,id) + '(' + CONVERT(varchar,count
(id)) + ')' as tot from tblname group by id

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 find the transaction log size in sql server?

515


How extra digits are handled with numeric data type literals?

520


What is bulkcopy in sql?

559


How do you migrate data from mssql server to azure?

151


What is temporary table in sql server? Why we use temp table?

516






What is cross join in sql server joins?

593


Explain contrast amongst grouped and non-bunched records?

516


Is sql server is free?

541


When would you use an insert into .. Select option versus an insert into .. Values option? Give an example of each?

648


Can you tell me about the concept of ER diagrams?

594


What are click through reports?

99


What is postgresql server?

512


can SSRS reports Cache results?

113


what is bit datatype and what's the information that can be stored inside a bit column? : Sql server database administration

536


What are the types of processing and explain each? : sql server analysis services, ssas

738