postgres 关于Python调用函数传参的问题

  1. 我有这样一个函数:func_report_incoming_detail(int,varchar(33)), 如何使用Python拼接sql 语句
        sql = "select func_report_incoming_detail({},{})".format(location_id or 'null', '2020-01-01' or 'all')
  1. pg函数传参的话还是尽量不传入null值,比如字符串和null 还挺难同时满足sql拼接
原文地址:https://www.cnblogs.com/qianxunman/p/13713403.html