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 constraints?
What is the difference between varchar and nvarchar?
Explain a checkpoint?
How to make remote connection in database?
How to use user defined functions in expressions?
Write a SQL query to make a column as unique?
What is a trace frag? Where do we use it?
How many servers can we create in a single subscription?
What is difference between getdate and sysdatetime in sql server 2008?
What are the kinds of subquery?
How do you create an execution plan?
What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?
Why is the need for data conversion transformations?
What is t-sql script to take database offline – take database online.
How do I find sql server instance name?