General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Dear Experts
CREATE CURSOR testsub (name c(15),bill n(3),amount n(4))
INSERT INTO testsub VALUES ('John',1,500)
INSERT INTO testsub VALUES ('Eric',2,900)
INSERT INTO testsub VALUES ('Eric',3,300)
INSERT INTO testsub VALUES ('John',4,800)
INSERT INTO testsub VALUES ('Eric',5,200)
INSERT INTO testsub VALUES ('Bush',6,400)
INSERT INTO testsub VALUES ('Eric',7,700)
INSERT INTO testsub VALUES ('Bush',8,100)
INSERT INTO testsub VALUES ('John',9,600)
In a cursor, I need Sub-Total and Grand-Total as follows
Bush----6----400
Bush----8----100
sub-T---2----500
Eric----2----900
Eric----3----300
Eric----5----200
Eric----7----700
sub-T---4----2100
John----1----500
John----4----800
John----9----600
sub-T---3----1900
Grd-T--19----4500
Note: In the following line of sub total
sub-T---2----500
2 is number of bills and 500 is sum of both bills
Please help
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only