Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL DELETE Records from multiple tables

Status
Not open for further replies.

CorfuVBProgrammer

Programmer
May 4, 2006
2
GR
Hello all . . .

I need some help about deleting rown from multiple tables.

Here is the structure
-----------------------------------------------------------

MODELS TABLE
|----------|
PK | mod_aa
|
|
|
|.. PRODUCT TABLE
.|...|------------|
.|...PK | prod_aa----|
.|-->FK | mod_aa.....|
.....................|
.....................|
..-------------------
..|. PHOTOS TABLE
..|. |-----------|
..|. PK | phot_aa
..|->FK | prod_aa
..|
..|
..|. COLORS TABLE
..|. |----------|
..|. PK | col_aa
..|->FK | prod_aa
..|
..|
..|. Dimensions TABLE
..|. |--------------|
..|. PK | dim_aa
..|->FK | prod_aa



WHERE PK = Primary Key AND FK = Foreyn Key
-----------------------------------------------------------

My problem is how to delete records from PRODUCT TABLE that are related with MODELS TABLE and records from Dimensions TABLE, PHOTOS TABLE and COLORS TABLE that are related with the deleted record on PRODUCT TABLE with one QUERY ? ? ?

Thanks . . . :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top