RE: [sqlite] Matching telephone strings

2004-04-11 Thread Steve O'Hara
What about this; SELECT * FROM stdcodes WHERE '0018764582' LIKE areacode || '%' order by areacode desc limit 1; Steve -Original Message- From: Lloyd thomas [mailto:[EMAIL PROTECTED] Sent: 11 April 2004 15:00 To: [EMAIL PROTECTED] Subject: Re: [sqlite] Matching telephone strings &g

Re: [sqlite] Matching telephone strings

2004-04-11 Thread Lloyd thomas
Thanks. Lloyd - Original Message - From: "Kurt Welgehausen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, April 11, 2004 4:58 PM Subject: Re: [sqlite] Matching telephone strings > > ..., but is it correct? > > No, very dangerous. You'

Re: [sqlite] Matching telephone strings

2004-04-11 Thread Kurt Welgehausen
> ..., but is it correct? No, very dangerous. You're depending on the values of band and destination just happening to be correct in this implementation. select areacode, band, destination from stdcodes where areacode = (select max(areacode) from stdcodes where '001212'

Re: [sqlite] Matching telephone strings

2004-04-11 Thread Lloyd thomas
>I think I have sussed it.< Well not quite!! If I extend the 'select' parameter to include other columns, there are instances where the results in those columns may not be related to what is in the left columns (as I would expect) and if you group the results, you end up with more than one

Re: [sqlite] Matching telephone strings

2004-04-11 Thread Lloyd thomas
I think I have sussed it. If you can see something wrong with the follwing let me know. code- SELECT MAX(areacode) AS areacode FROM stdcodes WHERE '0018764582' LIKE areacode || '%'; --- > Thanks Kurt, >

Re: [sqlite] Matching telephone strings

2004-04-11 Thread Lloyd thomas
Thanks Kurt, The GUI I was using to run the query seems to be using an old version of the SQLite DLL. I haved tried another one and the query has got me closer to what I want. The problem I now have is that I am getting too many results. ie. SELECT areacode FROM stdcodes WHERE

Re: [sqlite] Matching telephone strings

2004-04-10 Thread Lloyd thomas
Message - From: "Kurt Welgehausen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, April 11, 2004 12:20 AM Subject: Re: [sqlite] Matching telephone strings > > Is there any faster way I can compare these telephone numbers within sqlite? > > How about so

Re: [sqlite] Matching telephone strings

2004-04-10 Thread Kurt Welgehausen
> Is there any faster way I can compare these telephone numbers within sqlite? How about something like select areacode from stdcodes where $telno like areacode || '%' Regards - To unsubscribe, e-mail: [EMAIL PROTECTED]