I have a table like:
CREATE TABLE tbl_temp (id serial, friend_id int, name varchar(32));
I would like to run the following SQL:
PREPARE x AS SELECT {$1,friend_id} FROM tbl_temp WHERE id = ANY($2); EXECUTE x(33, ARRAY[1,2,3,4])
Basically, I'm looking for an instruction that will return an array of two ints to me, the first of which will be the user, and the second will be from a table column, such as friend_id.
Is this possible in PostgreSQL?
Please inform.
Results SELECT ($ 1, friend_id) FROM tbl_temp;
EXECUTE x(44); row
If I use PQgetvalue(PGres, 0, 0) What the result will look like: {44,45} or like(44,45)
Yours faithfully,
Mayank
arrays sql postgresql
Mayank
source share