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 procedure and function in sql?

540


Can we create index on primary key?

529


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

579


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

558


what is the difference between join and union? : Sql dba

556






What is trigger point?

542


How delete all records from table in sql?

557


what are the nonstandard string types? : Sql dba

614


What is constant in pl sql?

521


Define SQL and state the differences between SQL and other conventional programming Languages?

693


Explain the rollback statement?

581


What action do you have to perform before retrieving data from the next result set of a stored procedure ?

2099


What is record type in pl sql?

555


Is sql database free?

535


What is bulk compiling in pl/sql.?

613