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


Please Help Members By Posting Answers For Below Questions

explain different types of joins? : Sql server database administration

746


What are triggers in ms sql server?

843


Why I have to use stored procedures?

808


What are the different types of backups that exist?

887


what is memory-optimized nonclustered indexes

772


What are the components of sql server service broker?

711


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.

2569


How to delete multiple rows with one delete statement in ms sql server?

729


How to convert numeric expression data types using the cast() function?

754


What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

792


what is a live lock? : Sql server database administration

679


What is raid and what are different types of raid levels?

823


How do I view views in sql server?

735


What is replication and database mirroring?

814


how to define testing of network layers? : Sql server database administration

686