Results 1 to 4 of 4

Thread: Display Records

  1. #1
    Join Date
    Aug 2012
    Posts
    29

    Unanswered: Display Records

    I have two tables a purchasing table and a payment table for clients. I have a revenue field in both tables. How do I get my Revenue from my purchasing table to display in my Payment table?

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by kim40 View Post
    How do I get my Revenue from my purchasing table to display in my Payment table?
    You don't. You create a query that associates records from both tables using an INNER JOIN or a WHERE clause:
    Code:
    SELECT Table1.Column1, Table1.Column2, Table2.Column1, ...
      FROM Table1 INNER JOIN 
           Table2 ON Table1.ID_Table1 = Table2.ID_Table2;
    Or:
    Code:
    SELECT Table1.Column1, Table1.Column2, Table2.Column1, ...
      FROM Table1, Table2
     WHERE Table1.ID_Table1 = Table2.ID_Table2;
    The second syntax is obsolete, an INNER JOIN should always be used in such cases.
    Have a nice day!

  3. #3
    Join Date
    Aug 2012
    Posts
    29
    Thank u so much

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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