Код: Выделить всё
SELECT *
FROM quotation q
JOIN quotationdetail d
ON d.customer = q.customer
AND q.quoteid = d.quoteid
WHERE q.quoteid = 1
AND q.customer = 'john'
Код: Выделить всё
$this->db->select('*');
$this->db->from('quotation');
$this->db->join('quotationdetail', 'quotationdetail.customer = quotation.customer', 'inner');
$this->db->where('quotation.quoteid','1');
$this->db->where('quotation.customer','john');
$query = $this->db->get();
Код: Выделить всё
q.quoteid = d.quoteidПодробнее здесь: https://stackoverflow.com/questions/633 ... expression
Мобильная версия