首页 > mysql python query with null value,最佳实践是如何的?

mysql python query with null value,最佳实践是如何的?

我知道必须使用is null,以及null!=null
但是考虑这么个函数


def find(name=None, id=None):
    cursor.execute("select * from t_name where name=%s, id=%s", (name, id))
    

像这样参数化的场景中,难道我要为每个可能为 null 的值重写一句带is的 sql?

【热门文章】
【热门文章】