MySQL Forums
Forum List  »  MySQL Workbench

Update Previous Value and replace null to previous value
Posted by: suman amara
Date: April 10, 2014 06:09AM

Hi All,

Please find the below scenario to sum previous value and replace zero to previous value.

Create table joborder ( jo_no int(10), jo_date datetime, jo_status char(10) );

insert into joborder values( 1,'01-03-13','A');

insert into joborder values( 2,'01-03-13','A');

Insert into joborder values (3,'01-03-13','A');

insert into joborder values( 4,'04-03-13','A');

insert into joborder values(5,'08-03-13','B');

insert into joborder values( 6,'12-03-13','C');

Status: A means Completed B means Progress C means Dev

I want a report as below

Date TotalJoborder A B C

01-03-13 3 3 0 0

04-03-13 1 0 1 0

08-03-13 1 0 1 0

12-03-13 1 0 0 1

I want a report as below should increment previous values and display previous value as well.

Date TotalJoborder A B C

01-03-13 3 3 0 0

04-03-13 4 3 1 0

08-03-13 5 3 1 1

12-03-13 6 4 1 1

Options: ReplyQuote


Subject
Views
Written By
Posted
Update Previous Value and replace null to previous value
1854
April 10, 2014 06:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.