What I need is a conversion from a date to the half-year:
I did not find anything like that here Round and Truncate in Oracle
So, no built-in function exists indeed? I'm quite perplexed because that's not a very rare use case. Or have I missed something?
Just use a case
expression:
select (case when extract(month from datecol) <= 6 then 1
else 2
end) as half_year