I've a query like
SELECT t3 FROM tbl_join WHERE t2=3 AND t1 in (1,2,3);
and the output is:
t3
----
1
1
(2 rows)
It gives only two rows as entry for t3 is not present. Is it possible to modify the SELECT query something like:
SELECT t3||0 FROM tbl_join WHERE t2=3 AND t1 in (1,2,3);
to get the result like
t3
----
1
1
0
(3 rows)
I mean, is it possible to write a query where one can get output with no. of rows equal to the no. of arguments in in clause. If an entry is not present output should come as some constant value for the corresponding input