I have one table,in that table
(1)i have java1.1 version books are 2 and java1.5 version
books are 4.
(2).Net2.0 books are 3, .Net3.5 books are 2
(3)ABC1.6 books are 4, ABC2.0 books are 3.
Now i want output is like
Book Count
Java 6
.Net 5
ABC 7
For this i need sql query, please help me if anyone how to
get this result.
Thanks,
Seenu
Answer Posted / ravi
Hi Seenu,
Please find the Query below.
select rtrim(bk_nm,'0123456789.'),sum(bk_cnt) from books
group by rtrim(bk_nm,'0123456789.')
where bk_nm is the name of the books you wrote and bk_cnt
is their individual count. Run this Query and you'll get
your answer.
In case of doubts do feel free to ask.
Thanks,
Ravi Jha
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
how can we take a backup of a mysql table and how can we restore it. ? : Sql dba
What is the difference between null value, zero, and blank space?
Differentiate between pl/sql and sql?
What is PL/SQL Records?
What is cte sql?
What is a Mapplet?
How many joins in sql?
What is bulk compiling in pl/sql.?
Which join condition can be specified using on clause?
Does mysql_real_escape_string prevent sql injection?
What are % type and % rowtype?
How many types of indexes are there in sql?
What is the difference between sql, mysql and sql server?
How does cross join work?
How to create a menu in sqlplus or pl/sql?