I have table1 with columns:
def_id, def_name, username etc
I have another table table2 which has some association:
assoc_id,parent_id,child_id
The parent_id , child_id are actually def_id's from Table1 . They get inserted into Table2 based on parent_child relation user action in GUI.
Now I want to select all def_id for a particular username from Table1 and then use that input to delete all the records if those def_ids are part of the parent_id or child_id from Table2.
How do I do this in SQL? I am using Sybase database.
Any help will be appreciated