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 user defined functions? : Sql dba

542


What are the rules to be applied to nulls whilst doing comparisons?

746


What is the use of primary key?

530


What are the different tcl commands in sql?

614


how to fetch alternate records from a table? : Sql dba

584






what is sql in mysql? : Sql dba

565


What is the difference between microsoft access and sql?

491


What is sql basics?

571


How is use pl and sql?

547


What is trigger in sql?

574


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

503


Sql technical questions

768


Is stored procedure faster than query?

556


what is foreign key? : Sql dba

579


What are different types of indexes?

506