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 difference between left and right outer join?
Create a dts package to produce a text file using the ‘update statistics’ command for the tables in a database with obsolete statistics.
How do you improve the performance of a SQL Azure Database?
How do I run sql server 2014?
How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?
what purpose does the model database serve? : Sql server database administration
What gets stored inside msdb database?
What is use of attribute hierarchy optimized state? : sql server analysis services, ssas
What are the disadvantages of merge replication?
What are the benefits and tasks of object explorer? : sql server management studio
What is mssql?
What is a scheduled job or what is a scheduled task?
What is the security model used in sql server 2005?
What is the difference between a clustered index and a non-clustered index?
What it means to be triggered?