python中sql查询in的使用 2022年12月29日11:55:31 记一次python开发中遇到查询sql条件为in时,写法如下: sql = "SELECT * FROM tb_attribute WHERE name in ({}) and is_delete = 0".format( ','.join(["'%s'" % item for item in names]))