0

I am trying to achieve as example below can someone help me out please.

now I am doing like this


CREATE TABLE transfers
id               serial,
init_by          varchar(50),
init_to          varchar(50),
to_location      varchar(50),
from_location    varchar(50)

SELECT id, init_to, to_location as location
FROM transfers WHERE init_by = 'abc';

SELECT id, init_from, from_location as location
FROM transfers WHERE init_to = 'abc';

Now I need to query 2 times and then merge both results. How can I achieve it in single query Thanks in advance.

9

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.