why should I use _ instead of * wildcard in "like"? #25
-
I noticed that inside of access db I can do ""select '21' like '2*';" and it returns -1. If I do the same in jupyter notebook with sql alchemy, it returns "0". I found out that wildcard becomes underscore _ and I have to modify queries replacing * with _ in jupyter notebook. Why is it so? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When Microsoft Access was first being developed over 30 years ago (initial release was 1992), the decision was taken to use When the Access ODBC driver and OLEDB provider were implemented, the decision was taken to use the ANSI standard The unfortunate outcome was that For more details, see this Stack Overflow answer (and comments) here. |
Beta Was this translation helpful? Give feedback.
When Microsoft Access was first being developed over 30 years ago (initial release was 1992), the decision was taken to use
*
and?
as wildcard characters for theLIKE
clause. We can assume that this was at least partly due to the fact that those characters were used by MS-DOS and Windows for pattern matching (e.g.,del temp*.*
from the DOS prompt), and therefore would be less confusing for Windows users new to working with databases.When the Access ODBC driver and OLEDB provider were implemented, the decision was taken to use the ANSI standard
%
and_
characters forLIKE
. This was probably a difficult choice, betting on whether it was worse to annoy the "Access people" (by switching to%
)…