Here, using CASE Statement
and find result:
select (case when condition1 then result1
when condition2 then result2
else result3
end) as columnname from tablenmae:
For example:
select (CASE WHEN IDParent< 1 then ID
else IDParent END) as columnname
from tablenmae