Test for null in function with varying parameters

前端 未结 4 639
一生所求
一生所求 2020-12-01 08:27

I have a Postgres function:

create function myfunction(integer, text, text, text, text, text, text) RETURNS 
table(id int, match text, score int, nr int, nr         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 09:26

    If you can modify the query, you could do something like

    and (ad_postcode = $4 OR $4 IS NULL)
    

提交回复
热议问题