I’ve this db structure:
Message
msg_by usertype message
2 U how are you ?
1 A i'm fine
SimpleUser
id fullname
1 mike
2 john
AdminUser
id fullname
1 frank
2 lucas
Ok, i know it’s not correct to split users into two table but i’ve inherited this project.
My question is how to make a query making joining Message with SimpleUser and AdminUser … with the result to have the correct name for each message based to usertype: if U the message is from SimpleUser table, if A the message is from AdminUser
Thank you for your help!
With a
UNION: