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

Answers were Sorted based on User's Feedback



I have one table,in that table (1)i have java1.1 version books are 2 and java1.5 version books ar..

Answer / 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

I have one table,in that table (1)i have java1.1 version books are 2 and java1.5 version books ar..

Answer / oraclecodec

There must be some column such as 'TECHNOLOGY' that should
distinguish java ,.net and ABC apart from their versions.
Then its easier to arrive at a solution

SELECT TECHNOLOGY,COUNT(*) FROM BOOK GROUP BY TECHNOLOGY;

Is This Answer Correct ?    8 Yes 3 No

I have one table,in that table (1)i have java1.1 version books are 2 and java1.5 version books ar..

Answer / arunarevathi.s

hi seenu,
in this table have three coloumn thats are
book,version,numofbooks.
The query for u,
sql>select book,sum(numofbook)as count from book
group by book;


By,
aruna

Is This Answer Correct ?    4 Yes 0 No

I have one table,in that table (1)i have java1.1 version books are 2 and java1.5 version books ar..

Answer / suman maan

select substring(trade,1,(len(trade)-3)) as
trade,sum(no_ofbooks)
from test
group by substring(trade,1,(len(trade)-3))


Trade is bookname like(java1.1,.Net305)
no_ofbooks as indivisual book count

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

Hi how to import oracle sequence in Informatica? Please write stored procedure code that will import oracle sequence in Informatica SP transformation as per below scenario Oracle table product list Pro_id, pro_name 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights Now a new flat file with new product list needs to be added to oracle table product list with oracle sequence. flat file product Prono,pro_name, 1, 20 watt tube light 2, 30 watt tube light & target should be like 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights. 104, 20 watt tube light 105, 30 watt tube light thks reg suvarna joshi suvarnaatsuvarna@rediffmail.com

0 Answers   TCS,


What is sql query optimization?

0 Answers  


List the various privileges that a user can grant to another user?

0 Answers  


Why do we use joins?

0 Answers  


package specification-3 procedures package body-2 procedures will is execute

2 Answers   PWC,






what are the authentication modes in sql server? : Sql dba

0 Answers  


Explain sql data types?

0 Answers  


write the Sql query for creating database backup?

7 Answers   TCS,


How do you determine the current isolation level? : Transact sql

0 Answers  


what is the difference between a local and a global temporary table? : Sql dba

0 Answers  


What does plvtab enables you to do when you showthe contents of pl/sql tables?

0 Answers  


what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

0 Answers  


Categories