I am using Oracle and I have a table for expenditures that stores a person's ID
when the expenditures is approved. The person's ID is from a People table.
When I query, I want to make a new variable that references the other table to
put in their full name. I have two problems doing this.
1
daniel kessler wrote:
1 - I'm not so good at sql and the join only works if there's an id in the
approved_by field. This is going to be empty unless the ticket has been
approved, but I still want it to work whether it's approved or not. Is that
an outter join?
Yes it will be an LEFT
I had continued to try and figure it out after I sent the email. I did figure
out a way to make it work.
FROM expenditures e, people p
WHERE e.approved_by = people.id (+)
In Oracle, the + does the outer join. And it worked well, but it wasn't
explicit. I don't know sql well enough to read
daniel kessler wrote:
I had continued to try and figure it out after I sent the email. I did
figure out a way to make it work.
FROM expenditures e, people p
WHERE e.approved_by = people.id (+)
In Oracle, the + does the outer join.
Yes, that is the original outer join syntax for Oracle.
4 matches
Mail list logo