I have the following query:
strsql = """SELECT referencia, concepto, sfamilia, pvp, puc FROM almacen2 WHERE concepto like '*YATEKOMO*'"""
I use this sentence in python with the Access Driver.
When I execute this in my code:
strsql = """SELECT referencia, concepto, sfamilia, pvp, puc FROM almacen2"""
I get a lot of results.
And when I try to execute the query with the tag LIKE in Access directly, I get 8 results.
What's my mistake so I get results out of my code and not in it?
答案 0 :(得分:0)
使用%
代替*
。
或者使用concepto ~ 'YATEKOMO'
糟糕,我可以看到这与访问有关。我的答案更适合PostgreSQL。