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 / saravanan p
Select cast(idKey as varchar)+'('+cast(count(idKey) as
varchar)+')'
from #tbl1 group by idKey
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
How to view existing indexes on an given table using sys.indexes?
How to concatenate two character strings together?
How to connect php with different port numbers?
What does truncate do?
List all types of constraints in sql server?
Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
What is ms sql server service broker?
Explain system functions or built-in functions? What are different types of system functions?
What happens if ntwdblib.dll is missing on your machine?
What is change data capture (cdc) in sql server 2008?
What is the difference between a local and a global temporary table?
Explain the working of sql privileges?
What is partitioned view?
What do you mean by recursive stored procedure?
What is a coalesce function?