I'm fairly new to Oracle. Can I put an "if" statement within my "select" statement to determine what value i'm returning?
for example:
select
field 1,
field 2,
field 3,
if field 4 in (select field 1 from TABLE 2)
(here I want to return string "Yes"
else
(here I want to return string "No"
end if,
field 5
from Table 1
Basically, I need to return a Yes if this record's ID exists in another table. I thought using an if statement within my select statement would be a way to do it, but I can't figure out the syntax.
Thanks
for example:
select
field 1,
field 2,
field 3,
if field 4 in (select field 1 from TABLE 2)
(here I want to return string "Yes"
else
(here I want to return string "No"
end if,
field 5
from Table 1
Basically, I need to return a Yes if this record's ID exists in another table. I thought using an if statement within my select statement would be a way to do it, but I can't figure out the syntax.
Thanks