Left Join with 2 conditions

Left Join with 2 conditions

ostmalostmal Posts: 102Questions: 33Answers: 0
edited April 2020 in Free community support

Hi!
I studied the left Join() method:
https://editor.datatables.net/manual/php/joins
I use it in my work, there are no problems.
There was a need to make TWO conditions in left Join (). For example, in an SQL query, it would look something like this:

LEFT JOIN sites ON sites.id = users.site AND site.id_tbl = users.id_tbl

I didn't see that possibility. I don't know how to do it yet.

Answers

  • allanallan Posts: 63,208Questions: 1Answers: 10,415 Site admin

    Hi,

    The only "proper" way of doing this at the moment is to use a VIEW from which to read the table.

    However, there is a workaround discussed here which should do the trick for you.

    Allan

  • ostmalostmal Posts: 102Questions: 33Answers: 0

    thank you, allan

This discussion has been closed.