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

How you can get a list of all the table constraints in a database?

746


What is the difference between a primary key and a unique key? Are they the same?

843


What is 3nf normalization form?

817


Is it true, that there is no difference between a rule and a check constraint?

760


Tell me what is a linked server?

823


What command would you use to add a column to a table in sql server?

1049


What are different types of roles provided by ssrs?

130


What is checkpoint process in the sql server?

775


Explain about temporary stored procedure?

714


Explain what are the different index configurations a table can have?

902


What is row_number()?

800


What is mapping schema?

825


What is difference between temp table and cte?

793


what's new in sql server 2016?

772


How to add an address record into adventureworkslt?

793