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

What security features are available for stored procedure?

585


What is buffer cash in sql server?

598


What are built in functions?

570


What is a non equi join?

534


What is master database? : SQL Server Architecture

521






Is oracle faster than sql server?

549


How to configure and test odbc dsn settings?

566


What is collation?

713


how to invoke a trigger on demand? : Sql server database administration

561


Which sql server table is used to hold the stored procedure script?

472


How to add code to the existing article (using improve article)?

583


Is it possible to call a stored procedure within a stored procedure?

549


What are the different types of replication you can set up in sql server?

523


What is a cursor, index in sql?

566


How to use the inserted and deleted pseudo tables?

536