您好我正在尝试使用通配符查询:
c.execute( """ select seq_id from schema.table1 where table_id = :table_id and context_2 like :recipe_name || '%' """, {"table_id" : table_id, "recipe_name" : recipe_name} )
result:
res = []
当我改为
c.execute( """ select seq_id from schema.table1 where table_id = :table_id and context_2 like \'%abc%\' """, {"table_id" : table_id} )
result:
res = {list}[(166,),(167)]
我的代码可能有什么问题?我使用相同的逻辑:var_name || '%'