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
What is the stored procedure?
Why we need sql server?
What stored by the master?
What is mscorsvw.exe - process - microsoft .net framework ngen?
explain different types of backups avaialabe in sql server? : Sql server database administration
How to make remote connection in database?
What are the difference between primary keys and foreign keys?
what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration
what is the main function of a query parameter?
What is the current limitation of the size of SQL Azure DB?
How to insert and update data into a table with "insert" and "update" statements?
What is field with example?
How to search for a string in all stored procedure in sql server?
Differentiate between delete and truncate.
Why use “nolock” in sql server?