MySQL Forums
Forum List  »  General

Re: I need solution for this issue.
Posted by: Jaya kumar
Date: August 04, 2016 11:36PM

CREATE TABLE `test`.`trans` (

`id` INT NOT NULL AUTO_INCREMENT ,

`EmpNo` INT NULL ,

`Recept` DECIMAL(18,2) NULL ,

`Payment` DECIMAL(18,2) NULL ,

`Status` VARCHAR(45) NULL ,

`Date` DATE NULL ,

PRIMARY KEY (`id`) );




INSERT INTO `test`.`mas` (`Name`, `Balance`, `EmpNo`) VALUES ('John', '1500', 1001);

INSERT INTO `test`.`mas` (`Name`, `Balance`, `EmpNo`) VALUES ('Wesley', '2500', 1002);

INSERT INTO `test`.`mas` (`Name`, `Balance`, `EmpNo`) VALUES ('Kilbert', '3500', 1003);

INSERT INTO `test`.`mas` (`Name`, `Balance`, `EmpNo`) VALUES ('Rajas', '4500', 1004);





INSERT INTO `test`.`trans` (`EmpNo`, `Recept`, `Payment`, `Status`, `Date`) VALUES (1001, '120', '130', 'ACTIVE', '2015-02-01');

INSERT INTO `test`.`trans` (`EmpNo`, `Recept`, `Payment`, `Status`, `Date`) VALUES (1001, '130', '150', 'REJECT', '2015-04-04');

INSERT INTO `test`.`trans` (`EmpNo`, `Recept`, `Payment`, `Status`, `Date`) VALUES (1001, '180', '140', 'ACTIVE', '2015-06-06');

INSERT INTO `test`.`trans` (`EmpNo`, `Recept`, `Payment`, `Status`, `Date`) VALUES (1002, '250', '250', 'ACTIVE', '2015-03-03');

INSERT INTO `test`.`trans` (`EmpNo`, `Recept`, `Payment`, `Status`, `Date`) VALUES (1004, '320', '321', 'REJECT', '2015-04-04');



I need Following Condition Output.

1.Need Left Join mas and trans table for match or not in empno
2.when the record mas and trans presence i need check status active records only shown.
3.opening balance calculation like this
before from date which we entered sum following field mas table Balance+Recept-Payment

Options: ReplyQuote


Subject
Written By
Posted
Re: I need solution for this issue.
August 04, 2016 11:36PM


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.