Postgresql – division by zero in and expression
One of methods to handle zero-division error is to use case when structure. set start '2024-05-20' set end '2024-05-31' set change (q2.close-q1.close)/q1.close select q1.ticker,q1.date, case when q1.close=0 then null else :change end from quote q1,quote q2 where q1.ticker=q2.ticker and q1.date=…