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 is the stored procedure?

564


Why we need sql server?

561


What stored by the master?

547


What is mscorsvw.exe - process - microsoft .net framework ngen?

529


explain different types of backups avaialabe in sql server? : Sql server database administration

595






How to make remote connection in database?

599


What are the difference between primary keys and foreign keys?

543


what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration

589


what is the main function of a query parameter?

111


What is the current limitation of the size of SQL Azure DB?

102


How to insert and update data into a table with "insert" and "update" statements?

512


What is field with example?

517


How to search for a string in all stored procedure in sql server?

539


Differentiate between delete and truncate.

578


Why use “nolock” in sql server?

563