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 / hanamesh havale
select top 10 cast(key as varchar)
+ '(' + cast(count(key) as varchar) + ')'
from TableName
group by key
Hanamesh Havale
Influx Infotech
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain magic tables in sql server?
What are the advantages of policy management?
What is a print index?
How to list all login names on the ms sql server?
Tell me what is a linked server?
What is compression - row-level and page-level compression?
Tell me about pre-defined functions of sql?
Please explain what is “asynchronous” communication in sql server service broker?
Do you know how to implement service broker?
What is difference between views and stored procedures?
Why use sub query in sql server and list out types of sub queries?
How to join two tables in a single query in ms sql server?
Explain an incremental backup?
Tell me about the approaches which you used to counter the DI problems.
Explain aggregate functions?