I have a table i'm trying to INNER JOIN twice. Here's my example:
Table1:
id1, id2, otherInfo
Table2:
id, Name, phone, address
In this example, I need to get the name and phone for id1 and id2. How do I accomplish this? How do I handle if id1 = 0?
I have a table i'm trying to INNER JOIN twice. Here's my example:
Table1:
id1, id2, otherInfo
Table2:
id, Name, phone, address
In this example, I need to get the name and phone for id1 and id2. How do I accomplish this? How do I handle if id1 = 0?
2条答案
按热度按时间thigvfpy1#
You can try with
inner join
:In case
id1
orid2
can benull
, useleft join
instead.wlzqhblo2#
Your question is a bit vague but I think this is what you are looking for.