Hi,
I have a query which seems like it should easy, but isnt. I have two
tables, a and b that look like this:
a)
id | c1
--+--
1 | a
2 | b
3 | c
b)
id | c2
--+--
2 | b
and I would like to do a query which returns
id | c1 | c2
--+--+--
1 | a |
2 | b | b
3 | c |
The simplest thing I could find was
SELECT a.*, (SELECT b.c2 WHERE a.id=b.id) AS c2;
This works, but is extremely slow for more complex examples. Is there a
better way to do this in postgresql?? I think MS Access has inner and
outer joins to solve this problem. Is there a postgresql equivalent?
Thanks for the help.
David Kaplan