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

What happens when converting big values to integers?

568


What is the function of inner join?

558


How to test a dml trigger in ms sql server?

575


What do you understand by SQL*Net?

613


What is exporting and importing utility?

604






Will sql server 2005 allow you to reduce the size of a column?

550


How to drop an existing user defined function in ms sql server?

562


Explain what is use of dbcc commands?

509


How to call a function from a stored procedure in SQL Server ?

548


How to create a simple table to test triggers in ms sql server?

510


What is a non-clustered index?

562


What are the differences between substr and charindex in sql server.

497


How can a user-defined datatype be created?

540


What is default port number for sql server 2000?

593


What is a system database and what is a user database?

578