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 / pradip jain
select convert(varchar,key) + '('+ convert(varchar,
count(key))+')' from table_name group by key
Hanamesh, why top 20?
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the functions in sql server?
What is cross join in sql server joins?
What are the different type of replication in sql server?
what are the disadvantages of cursors? : Sql server database administration
How to handle error or exception in sql?
What are dml (data manipulation language) statements in ms sql server?
How to view existing indexes on an given table using sys.indexes?
What is explicit cursors?
What are the database objects? : SQL Server Architecture
How to insert multiple rows with a subquery?
What are the different types of data sources in ssrs?
What stored by the master?
What is the difference between nvl and nvl2?
What are different types of replication in sql server?
How can a user-defined datatype be created?