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
Define self join in sql server joins?
What does it mean to invest in the index?
What is subquery explain with example?
What are the different types of indexes?
how you can configure a running aggregate in SSRS?
How to make remote connection in database?
How can you set the threshold at which sql server will generate keysets asynchronously?
hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.
Can foreign key be duplicate?
Which database stores information about replication?
role of sql sever 2005 in database rather than any other database
What is function of ROLLUP ?
What do you understand by hotfixes and patches in sql server?
What is a with(nolock)?
What is difference between inner join and join?