[INTERFACES] Pattern matching fun via ODBC
От | Mike Mascari |
---|---|
Тема | [INTERFACES] Pattern matching fun via ODBC |
Дата | |
Msg-id | 385E2C56.7355C6F2@mascari.com обсуждение исходный текст |
Список | pgsql-interfaces |
>David C Hartwig Jr wrote: > > Mike Mascari wrote: > > > Hello, > > > > SELECT workorders.workorder, workorders.workorderno, > > equipment.assetno, equipment.controlno > > FROM workorders, equipment > > WHERE equipment.assetno LIKE '%214%' > > AND workorders.equipment=equipment.equipment > > ORDER BY workorders.workorder; > > > > gets re-written by Access as this: > > > > "SELECT "workorders"."workorder","equipment"."equipment" > > FROM "equipment","workorders" > > WHERE (("equipment"."assetno" = '%214%' ) > > AND ("workorders"."equipment" = "equipment"."equipment" ) ) > > ORDER BY "workorders"."workorder" > > I don't have Access 97 installed on any of my systems at this time, so > I cam not verify what I am about to say. But I seem to recall that > Access uses asterisk (*) as the wild card character. I think it is > the MS Jet Engine that is transforming your statements. I believe the > Jet sees the percent (%) character as just another character and so in > its infinite wisdom optimizes for you - transforming the LIKE to an > equal (=). Pretty thoughtful of them. :>( > > I believe (in the context of a LIKE expression) the Jet will transform > your asterisks (*) to percents (%). Unbelievable! You're absolutely correct. I had tried using asterisks with the equality operator, but I had never thought to use both LIKE and asterisks. Wow! Thanks... Mike Mascari
В списке pgsql-interfaces по дате отправления: