0

I have three tables:

1. [Car]

2. [CarDetails]

3. [Car_Items]

[Car] has columns ([Car_Name], [Car_Colour])

[CarDetails] has columns ([ModelNo], [CarPrice])

[Car_Items] has columns ([wheels], [Doors])


I want to ask that if I want to update the data in these three tables where

Car.id = CarDetails.id = Car_Items.id 

Can anyone please tell me a better way on how I could update the data in these tables?

cch
  • 3,336
  • 8
  • 33
  • 61
  • 1
    Updating 3 tables takes 3 update statements. Set values for the fields in one table, then move on to the next – crthompson Apr 17 '15 at 17:52
  • 1
    put it into a procedure with transaction logic to allow rollback and write 3 updates. – xQbert Apr 17 '15 at 17:53
  • 1
    Which DBMS are you using? Postgres? Oracle? –  Apr 17 '15 at 18:09
  • possible duplicate of [MySQL, update multiple tables with one query](http://stackoverflow.com/questions/4361774/mysql-update-multiple-tables-with-one-query) – Steph Locke Apr 17 '15 at 18:10
  • You can't. Please see http://stackoverflow.com/questions/2044467/how-to-update-two-tables-in-one-statement-in-sql-server-2005 – Luigi Apr 17 '15 at 19:56

0 Answers0