Skip to content

Any support for: join .... on .... and ... #294

Closed
@ghost

Description

Hi

I'm attempting to do something like this:

SELECT 
    Table1.IDField, Table2.IDField
FROM 
    Table1
LEFT OUTER JOIN Table2 
    ON Table1.PersonID = Table2.PersonID
    AND Table2.Category = 'Foo'
WHERE 
    Table1.IDField = '12345'

I've able to do the following but I was wondering if there is a better way within the class?

$this->db->join('table prefix', table.id = join_table.id AND join_prefix.id = 1', 'LEFT');

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions