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 select true false based on column value in sql server?
What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?
What is a data source or ds? : sql server analysis services, ssas
How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?
What are the properties and different types of sub-queries?
What are magic tables in sql server?
what are candidate key, alternate key and composite key? : Sql server database administration
How to list all login names on the ms sql server?
Define synonym?
Differentiate between a primary key and a unique key.
Some queries related to SQL
What is a with(nolock)?
How do I find the query plan in sql server?
What is Service Broker in sql server 2012?
Where are sql server usernames and passwords stored in the sql server?