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
Why would you use sql agent?
What is tabulation?
What are the advantages of using a stored procedure?
What is the user of Primary key?
What is the purpose of a table?
Do you know what is raid and what are different types of raid configurations? : SQL Server Architecture
Explain the use of containers in ssis and also their types?
Is foreign key a primary key?
What is the difference between DATETIME2 and DATETIME?
What objects does the fn_my_permissions function reports on? : sql server security
How can we rewrite sub-queries into simple select statements or with joins?
What is data source document?
Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?
What is the use of @@spid?
What is the difference between a function and a stored procedure?