"Tom Allison" <tom@tacocat.net> writes:
> OK, after reviewing many emails and what I was trying to do I upgraded from 8.2.
>
> Seems to work as it did in 8.1 which is a good start.
>
> I'm doing all of this so I can use the 'values' that was described as being
> something like:
>
> select * from (values ('one','two','three')) "foo";
SELECT * FROM (VALUES ('one'),('two'),('three')) AS foo(value)
> I initially thought that I could do this with:
> select t.value, v.value from
> values('one','two','three') left outer join mytable using (value)
postgres=# SELECT *
FROM (VALUES ('one'),('two'),('three')) AS foo(value)
LEFT OUTER JOIN mytable ON (foo.value = mytable.value);
value | value
-------+-------
one |
two | two
three | three
(3 rows)
"USING" would work too but then you only get one output column rather than two
which is not so helpful in this case.
postgres=# SELECT *
FROM (VALUES ('one'),('two'),('three')) AS foo(value)
LEFT OUTER JOIN mytable USING (value) ;
value
-------
one
two
three
(3 rows)
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com