Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    3

    Unanswered: Share data between two tables ?

    Hi, my second question !, is it possible and how would I share data between two existing tables. ie: Customers Table and Orders Table.

    I need to have the contents of some fields from customers and copy them to replica fields in orders. I'm very, very new to this and basically been dropped in it at te deep end.

    Assistance would be very grateful.

    Cheers
    J#xx
    (Scott Perry)
    MySQL V 5.1.30.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by J#xx
    is it possible and how would I share data between two existing tables. ie: Customers Table and Orders Table..
    it is possible, with a trigger, but it is a very bad idea

    instead, why not use a foreign key to relate the order to the customer, and use a join query when you want to show this "shared" data

    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
  •