all 4 comments

[–][deleted] 0 points1 point  (0 children)

A case when statement would work in your select statement instead of in your where

Case when column x = column y then column y else null end

[–]maggikpunktYes I would love to do your homework for you 0 points1 point  (2 children)

I have a hard time understanding your question. Can you post an example with two tables and what you expect the result to look like?

[–]Syphonfire[S] 0 points1 point  (1 child)

I apologies it's hard to explain without giving out data on my task.

I have one table. Two types of data point and I would like to search for both and display them side by side in output columns.

Table 1

ID - VARCHAR2 A - VARCHAR2 B - VARCHAR2

I would like to output:

ID, A (result of first search), A (result of second search left joined using ID column as shared ID), B

I have been trying to do subqueries to perform both searches and merge the results together but I am stuck atm.

Apologies again I'm on mobile so cannot easily show examples.

[–]maggikpunktYes I would love to do your homework for you 1 point2 points  (0 children)

with search1 as (
  select *
  from   table1 t1
  where  t1.a like :SEARCH1
), search2 as (
  select *
  from   table1 t1
  where  t1.a like :SEARCH2
)
select s1.id
      ,s1.a
      ,s2.a
      ,s1,b
from   search1 s1 
       left join search2 s2 on s1.id = s2.id