i have this tables:
inbox table
SenderNumber Message
contact table
Name Number
district table
id SpvName Number
sub_district table
id district_id SpvName Number
village table
id sub_district_id SpvName Number
i want to get name or spvname from contact, district, sub_district or village, based from the SenderNumber column from inbox. How do i achieve this? the result maybe like this
SenderNumber | Name | Type | Message
-------------+------+--------------+------------
123 | john | contact | bla bla
234 | mary | district spv | bla bla bla
thanks in advance, and sorry for my bad english.