Re: [sqlite] Unusual use of the LIKE operator (long)

2007-08-19 Thread Rod Dav4is
Very nice: Identify a date format. *Anybody else? *-R.* * Andrew Finkenstadt wrote in part: 8>< and we select the date_format column based on the likeness of the date_pattern column, run it through to_date, catch any exceptions, and return the DATE column. --a -

Re: [sqlite] Unusual use of the LIKE operator (long)

2007-08-19 Thread Andrew Finkenstadt
In oracle there is the TO_DATE function which accepts at least two arguments: a field convertible to string, and a string defining the date format of the first field. This format string involves portions of date strings like '-MM-DD HH24:MI:SS' , our standard sortable no-timezone date format

Re: [sqlite] Unusual use of the LIKE operator (long)

2007-08-19 Thread Rod Dav4is
I'm not claiming to have invented anything new, as I was using similar techniques some 30 years ago in another life (in the employ of a large blue company which shall remain nameless :-[ ). Not in SQL, you understand. A pretty thorough search didn't turn up any such use in online SQL documentat

Re: [sqlite] Unusual use of the LIKE operator (long)

2007-08-19 Thread Andrew Finkenstadt
We've used this exact technique in a table called "ANY_DATE_FORMAT" since 1997... admittedly in Oracle, but the principle still applies. It's great for coalescing the number of states necessary to implement parsers. :) --andy On 8/18/07, Rod Dav4is <[EMAIL PROTECTED]> wrote: > > Conventional us

[sqlite] Unusual use of the LIKE operator (long)

2007-08-18 Thread Rod Dav4is
Conventional usage is as follows: ... WHERE column-name LIKE "string" Which, of course, selects rows where the values in the named column match the string, which can, and usually does, have wildcards. I have been using an inverted arrangement: ... WHERE "string" LIKE column-name This