Results 1 to 4 of 4
  1. #1
    Join Date
    May 2007
    Posts
    7

    Unanswered: Add/Subtract 2 Tables

    I want to know if mysql can merge two tables in a way that one certain column of both tables subtract each other. One table performs a mathematical add operation on the data in its certain column, while it performs a mathematical subtract operation of the certain column from the other table. At the end, it will output an answer for the total of the operation.

    I want to use this on my accounting table wherein the CREDIT table is subtracted by the DEBIT table, but i want all the entries to be presented, like Description of Credit, Description of Debit, date, amount, Credit_Transaction_ID, and Debit_Transaction_ID....

    Thanks
    Last edited by paloyme; 05-21-07 at 01:58.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sounds feasible
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2007
    Posts
    7
    you have any idea on how to achieve this?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sure -- start by showing us your JOIN and i can take it from there
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •