Codice PHP:
SELECT tabella1.product_id, tabella2.product_id, tabella1.order_id, tabella2.product_code,
tabella1.dettaglio1, tabella1.dettaglio2, tabella1.dettaglio3
FROM tabella1 LEFT JOIN tabella2
USING (product_id)
WHERE tabella1.product_id = tabella2.product_id;
la situazione è questa
- tabella 1
product_id
order_id
- tabella2
product_id
product_code
ora, io ho una terza tabella (chiamiamola tabella 3)
- tabella3
product_id
order_id
options
vorrei aggiungere alla query di sopra il campo tabella3.options. Qualche consiglio?