Postgresql – Is there a way to add subquery within case conditions?
I have the function below in Postgres which was working fine. but then I had to add other types, So I tried to add cases to it. But this isn't working as expected. Basically what I am trying to do…