From: | Tom Allison <tom(at)tacocat(dot)net> |
---|---|
To: | "PostgreSQL General ((EN))" <pgsql-general(at)postgresql(dot)org> |
Subject: | stuck on values in 8.2 |
Date: | 2007-05-12 14:51:10 |
Message-ID: | 72D75E4D-21E3-4FD6-9A62-561C6A2C2C9A@tacocat.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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";
But instead of getting three rows of one value each, I get three
columns of one row.
Not what I was looking for. :(
What I am doing now is run a large list (300+) of values that is
being iterated through a sql statement like: 'select * from mytable
where token = ?' to see if the value exists or not and then "do stuff".
A while back I was told that this would all be fixed if I used values
(...)
Did I misunderstand the proper care and feeding of the VALUES
statement or is there something else I need to do here?
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)
except
-- not sure how to name the column in values() to come out as name
"value"
-- and quite frankly I can't get anything to actually run other than
my first example.
Ideally the output would have something like:
v.value | t.value
----------+---------
one |
two | two
three | three
where the value 'one' is not in the table...
Am I still able to do something like this but don't have the syntax
correct?
Or am I more SOL than RTFM?
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2007-05-12 15:01:13 | Re: postgres upgrade |
Previous Message | Ray Stell | 2007-05-12 13:48:33 | Re: postgres upgrade |