sql - MYSQL, Take value from 'reported users' table and use name to delete from another table -


i'm not sure best way describe this,

i have table contains reported usernames users

'name' 'reason' 'gender' 'date'  joe     fake     male   10/10/2013 

the gender column tells me table username resides, in case 'male_users'

is there way/function take name column , gender , go corresponding table , delete username, without me having manually copy name - > change table -> search usernames 'joe' -> delete -> start over

i hope makes sense!

thanks

the best way use 2 commands in row:

delete male_users name in( select name users <logic> , gender='male' ); delete female_users name in( select name users <logic> , gender='female' ); 

Comments