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 / manju
select key,count(key)as"count of items" from tablename
group by key order by key
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the disadvantages of indexes?
Explain the functionalities that views support?
Why are views required in the sql server or in any other database?
Describe in brief databases and sql server databases architecture.
How to receive returning result from a query?
What is msdb database? : SQL Server Architecture
What are the different types of sql server replication? : sql server replication
Can you please explain the difference between primary keys and foreign keys?
Different types of keys in SQL?
What are the purpose of Normalisation?
Why should we go for stored procedures? Why not direct queries?
Give an example of SQL injection attack ?
Tell me what are cursors and when they are useful?
How to create a simple table to test triggers in ms sql server?
Give main differences between "Truncate" and "Delete".