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
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'
> ..., 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'
>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
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,
>
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
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
> 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]
8 matches
Mail list logo