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
How you can get a list of all the table constraints in a database?
What is the difference between a primary key and a unique key? Are they the same?
What is 3nf normalization form?
Is it true, that there is no difference between a rule and a check constraint?
Tell me what is a linked server?
What command would you use to add a column to a table in sql server?
What are different types of roles provided by ssrs?
What is checkpoint process in the sql server?
Explain about temporary stored procedure?
Explain what are the different index configurations a table can have?
What is row_number()?
What is mapping schema?
What is difference between temp table and cte?
what's new in sql server 2016?
How to add an address record into adventureworkslt?