Willy Laurents Willy Laurents - 1 year ago 63
SQL Question

how can i get record in another table (SQL)

i have 2 tables

table1 :

| id | request_id | user_id | mitra_id |


| mitra_id | mitra_name |

how can i get mitra_name using mitra_id in table1?

Answer Source
SELECT tab1.*
     , tab2.mitra_name
FROM table1 tab1
INNER JOIN table2 tab2
  ON tab2.mitra_id = tab1.mitra_id;

To learn some superbasic SQL:

W3Schools intro to SQL

W3Schools INNER JOIN lesson

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download