Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Not entirely sure I follow, but I <em>think</em> this does what you want:</p> <pre><code>with t as (select &lt;INPUT ID&gt; as input_id, &lt;INPUT DATE&gt; as input_date from dual) select input_id, input_date from t left join mytable mt on mt.id = t.input_id and mt.date = t.input_date; </code></pre> <p>With some sample data:</p> <pre><code>create table mytable (id number, date_fld date); insert into mytable (id, date_fld) values (1, date '2013-04-24'); insert into mytable (id, date_fld) values (2, date '2013-04-22'); insert into mytable (id, date_fld) values (2, date '2013-04-22'); insert into mytable (id, date_fld) values (2, date '2013-04-23'); </code></pre> <p>... and queries:</p> <pre><code>with t as (select 1 as input_id, date '2013-04-21' as input_date from dual) select input_id, input_date from t left join mytable mt on mt.id = t.input_id and mt.date_fld = t.input_date; INPUT_ID INPUT_DAT ---------- --------- 1 21-APR-13 with t as (select 1 as input_id, date '2013-04-24' as input_date from dual) select input_id, input_date from t left join mytable mt on mt.id = t.input_id and mt.date_fld = t.input_date; INPUT_ID INPUT_DAT ---------- --------- 1 24-APR-13 with t as (select 2 as input_id, date '2013-04-22' as input_date from dual) select input_id, input_date from t left join mytable mt on mt.id = t.input_id and mt.date_fld = t.input_date; INPUT_ID INPUT_DAT ---------- --------- 2 22-APR-13 2 22-APR-13 </code></pre> <p>Now I've typed that in I've got a nasty feeling I'm answering the wrong question, and you really want to transform the <code>{WHERE}</code> into a new query that does this. The interaction between the query and the application isn't very clear to me I'm afraid.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload