right, im totally baffled now, maybe im just having an off day and its dead simple but ive lost the plot. HEres my problem.
I got a table with parent records with children who can also have children. I need to delete a parent and all child records cascading down.
1) what would the query look like
2) is the table set out correctly
------------------------------------
| ID (PK) | CHILD | PARENT | NAME |
------------------------------------
the ID is made of a trimmed out datestamp and is the primary key, the child field is simply indicating wether it has children 1 = yes / 0 = no. And the parent shows 0 for a top level record or whatever value its parent has as a its value in the ID field.
typical hierachy would be
product1
product2
product3
product4
product5
product6
product7
so if i wanted to delete productset 3 it would select product sets 3, 4 and 5
any help greatly appreciated
cheers
'mi casa es su casa'
]-=tty0=-[
I got a table with parent records with children who can also have children. I need to delete a parent and all child records cascading down.
1) what would the query look like
2) is the table set out correctly
------------------------------------
| ID (PK) | CHILD | PARENT | NAME |
------------------------------------
the ID is made of a trimmed out datestamp and is the primary key, the child field is simply indicating wether it has children 1 = yes / 0 = no. And the parent shows 0 for a top level record or whatever value its parent has as a its value in the ID field.
typical hierachy would be
product1
product2
product3
product4
product5
product6
product7
so if i wanted to delete productset 3 it would select product sets 3, 4 and 5
any help greatly appreciated
cheers
'mi casa es su casa'
]-=tty0=-[