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 is table constraint?
What happens when converting big values to numeric data types?
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that
What are the differences between local and global temporary tables?
How to rename an existing column with sql server management studio?
What are the types of normalization?
What does the on update no action do?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
What are sql dirty pages?
Which trace flags are enabled in sql server?
What is difference between table aliases and column aliases? Do they affect performance?
Give the query of getting last two records from the table in SQL SERVER?
how you can configure a running aggregate in SSRS?
What is format parameter in ssrs?
When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?