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 / devraj
Table Str:- create table T
( COL1 NUMBER(2));
Data:- select * from t;
col1
1
1
1
2
2
3
3
4
4
5
5
5
Query:-
Select col1 || '(' || Count(col1) || ')' From t Group By
col1;
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
explain different types of joins? : Sql server database administration
What are triggers in ms sql server?
Why I have to use stored procedures?
What are the different types of backups that exist?
what is memory-optimized nonclustered indexes
What are the components of sql server service broker?
What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.
How to delete multiple rows with one delete statement in ms sql server?
How to convert numeric expression data types using the cast() function?
What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?
what is a live lock? : Sql server database administration
What is raid and what are different types of raid levels?
How do I view views in sql server?
What is replication and database mirroring?
how to define testing of network layers? : Sql server database administration