$query= mysqli_query($db,"SELECT a.*, b.collection_id , c.contract_id,
d.customer_name FROM rentals_invoice
AS b INNER JOIN rental_collection as a ON (b.collection_id = a.collection_id)
AS c INNER JOIN rental_contract as b ON (c.contract_id = b.contract_id)
AS d INNER JOIN customer_info as c ON (d.customer_id = c.customer_id)");
У меня есть таблицы a, b, c, d
'a', есть fkey of 'b'
'b', есть fkey of 'c'
'c' имеет fkey of 'd'
Я хочу получить данные от всех из них, и я не знаю, как получить их с помощью внутреннего соединения или любого другого типа соединения в одном запросе.
Я новичок.