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


Please Help Members By Posting Answers For Below Questions

Explain what is an index?

579


What is the mutating table and constraining table?

548


What is data abstraction in sql?

503


Is left join faster than inner join?

607


Write a query to find the names of users that begin with "um" in sql?

492






What is recursive join in sql?

542


What is using in sql?

551


Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?

527


What is a native sql query?

488


Show the cursor attributes of pl/sql.

604


Why use triggers in sql?

489


Are subqueries better than joins?

521


What does where 1 1 mean in sql?

535


- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

1379


Is nosql faster than sql?

534