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
What is a non equi join?
While you are inserting values into a table with the insert into .. Values option, does the order of the columns in the insert statement have to be the same as the order of the columns in the table?
How to backup SQL Server Reporting Services ?
How to get the definition of a user defined function back?
How to replace the Query Result 'Null Value' with a text ?
How does the report manager work in SSRS?
What is the primary use of the model database?
Tell me what is difference between view and materialized view?
How we can refresh the view?
Tell me when is the update_statistics command used?
What is sql server replication? : sql server replication
What is the benefit of normalization?
Why functions are used in sql server?
Find nth lowest salary or get nth lowest salary?
List the different normalization forms?