i have some doubt about my mysql query and wanted to discuss here. i have three tables tablea,tableb and tablec
tablea
id someid
1 434
2 352
3 329
tableb
id otherid cid
1 434 54
2 6934 2453
3 434 24
4 9548 67
here otherid is appearing more than one time and also appearing once in tablea
tablec
id otherid cid
1 all deleted row details of tableb will be stored here
what i am doing
selecting one random row from tablec and matching someid with otherid and as i want to store the tableb details in tablec so first i am performing insert into for tablec and then deleting the tableb row it seems to be correct but in tableb more than one rows are there so deleting is not an issue as i can directly match with someid and delete all rows from tableb but in tablec i have to insert the cid values also so if i will do as ihave explained it will work fine ?any suggestions are welcome