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 / rajkumar.v
select convert(varchar,id) + '(' + CONVERT(varchar,count
(id)) + ')' as tot from tblname group by id
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to execute the cursor queries with "open" statements?
Do you know sql server 2008 backup compression?
What is transaction server consistency?
What are the events recorded in a transaction log?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
How to declare and use cursor variables?
Define right outer join in sql server joins?
What is dynamic cursor in SQL SERVER?
Explain user defined functions?
Can we call stored procedure in view in sql server?
What are the built in functions in sql server?
Difference between DELETE and TRUNCATE?
How to Insert multiple rows with a single insert statement?
Can the query output be sorted by multiple columns in ms sql server?
What is scalar user-defined function?