mysql - Deleting row involving joining of tables -


how delete userid 00002 product ordered when provided "tim" (where username = 'tim'). not userid, i'm aware of it.

user info ------------------ userid | username  00001  | jim 00002  | tim 00003  | steve 00004  | boo  product ordered ------------------ userid  | productcode 00002   | p0001 00002   | p0003 00001   | p0002 00003   | p0001 

delete po.* `product ordered` po inner join `user info` ui     on ui.userid = po.userid ui.username = 'tim' 

that should it.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -