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 to convert a unicode strings to non-unicode strings?
What is the difference between a unique key and primary key?
Does group by or order by come first?
Where cross join is used?
How to assign null values to variables or columns?
What is the tcp/ip port on which sql server runs?
Why use “pivot” in sql server?
What is a user-defined function in the sql server and what is its advantage?
Why use identity in sql server?
Define full outer join in sql server joins?
What samples and sample databases are provided by microsoft?
What is the difference between ‘having’ clause and a ‘where’ clause?
Explain how does the report manager work in ssrs?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
When a primary key constraint is included in a table, what other constraints does this imply?