0
I have the following tables in BD Oracle 11g
irrigation
----------------
militet_applied,
close_date
rainfall
---------------
rain_index,
reading_date
And I would like to make a select similar to that:
select r.rain_index,
i.militet_applied
from irrigation i, rainfall r
But in my where clause
I would like to do the following:
- If r.reading_date = i.close_date
bring me the values (i.militet_applied)
,
but also if
r.reading_date
be equal/not present in the column i.close_cycle
, bring me null values (i.militet_applied
).
I’m counting on you in this doubt.
It became a little difficult to understand the second part, from the "but also if...". This column
i.close_cycle
is another column ofirrigation
? Or was it a typo and refers to itselfi.close_date
?– Jônatas Hudler
e r.reading_date = i.close_date bring me the values (i.militet_applied), , but also if r.reading_date is equal/does not have in the i.close_cycle column, bring me null values (i.militet_applied). SELECT ... (CASE WHEN e r.reading_date = i.close_date THEN i.militet_applied ELSE NULL END but as you said @diegofm got confused
– Motta
Sorry for the error, yes I was referring to i.close_date
– JosefoSad