I'm looking to write a postgresql query to do the following :
if(field1 > 0, field2 / field1 , 0)
I've tried this query, but it's not working
if (field1 > 0)
then return field2 / field1 as field3
else return 0 as field3
thank youu
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…