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 / neeraj

If the column name is key
select key,count(*) from jojo
group by key

simple

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the recursive stored procedure in sql server?

527


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

1445


What are logical database components? : SQL Server Architecture

485


How to Insert multiple rows with a single insert statement?

551


what does the automatic recovery do? : Sql server administration

540






what is the difference in login security modes between v6.5 and 7.0? : Sql server database administration

656


What is the beast way to write CTE in SQL Server ?

566


How to list all schemas in a database?

582


What is constraints and its types?

504


Explain Geometry datatype in sql server 2008 with example

594


What is the difference between stored procedure and functions?

604


Explain triggers?

565


What is the difference between a local and a global temporary table?

629


List the different index configurations possible for a table?

517


What is a rollup clause?

547