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 / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the execution plan in sql?

539


What is the use of sql trace?

464


what are date and time functions in mysql? : Sql dba

524


What is varchar example?

558


What is the mutating table and constraining table?

544






Explain locks? : Transact sql

555


What is the meaning of disabling a trigger?

630


How much does a sql dba make? : SQL DBA

497


Explain what is a column in a table?

557


What is the difference between count 1 and count (*) in a sql query?

487


What are commit, rollback, and savepoint?

562


Can we call procedure in select statement?

510


How to find 3rd highest salary of an employee from the employee table in sql?

560


How do sql databases work?

519


What does stand for in sql?

511