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
What are extended events in sql server?
Mention the differences between sql server and mysql.
What is the difference between sdf and mdf?
What is a bit datatype?
How does clustered and non clustered index work?
It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio
What is data compression? : sql server database administration
What is the importance of a recovery model?
What is Transparent Data Encryption?
What is deploy, process and build? : sql server analysis services, ssas
What do you think of this implementation? Can this be implemented better?
What is the difference between count () and rowcount ()?
What are the differences between DDL, DML and DCL in SQL?
A trigger can reference objects outside the current database? State true or false.
How to transfer data from a cursor to variables with a "fetch" statement?