Welcome Guest, Not a member yet? Register   Sign In
natural join with CI Active Record
#1

[eluser]inari[/eluser]
How can I use natural join with Codeigniter Active Record?

Something like:
Code:
SELECT *
FROM   employee NATURAL JOIN department


C/P:

Quote:The NATURAL JOIN joins two tables which contain a column or multiple columns with the same name and data-type.

The following query joins the customer table to the invoice table with a natural join, the natural join utilizes the customer_id that is present on both the customer table and the invoice table. It returns the customer and invoice data for invoices that have not had any payments made on them.

Code:
SELECT customer_id, invoice_id, customer.first_name, customer.last_name
FROM CUSTOMER
NATURAL JOIN invoice
WHERE invoice.amount_paid = 0;

Thanks for any answer


Messages In This Thread
natural join with CI Active Record - by El Forum - 05-16-2008, 04:48 PM
natural join with CI Active Record - by El Forum - 05-16-2008, 04:59 PM
natural join with CI Active Record - by El Forum - 05-16-2008, 05:04 PM
natural join with CI Active Record - by El Forum - 05-16-2008, 05:24 PM
natural join with CI Active Record - by El Forum - 09-09-2008, 01:39 AM
natural join with CI Active Record - by El Forum - 09-09-2008, 02:34 AM
natural join with CI Active Record - by El Forum - 09-09-2008, 02:38 AM
natural join with CI Active Record - by El Forum - 09-11-2008, 06:17 AM
natural join with CI Active Record - by El Forum - 09-16-2008, 10:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB