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
How you can get a list of all the table constraints in a database?
What are the fixed server level roles? : sql server security
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
How to include date and time values in sql statements?
Explain the dbcc pintable command when would you use it?
How to make conditional sum in ssrs?
What are the new features are introduced in sql server 2012 reporting services?
What is the difference between local and global temporary tables?
What is 1nf 2nf and 3nf?
What is partition index in sql server?
How extra digits are handled with numeric data type literals?
What is save transaction and save point?
Mention the differences between local and global temporary tables.
Who is the owner of a schema in ms sql server?
What protocol does sql server use?