RaghavendraK 70574
<[EMAIL PROTECTED]> wrote:
insert into 'tbl.7'
values
(7, '9845002655', '1', '1', '1', '1','x','x','x',
'x','x');
insert into 'tbl.7'
values
(7, '9855002655', '1', '1', '1', '1','x','x','x',
'x','x');
--Best match for 985 shd be 9855002655
select * from 'tbl.7' where '985' like column1 || '%' order by
column1 desc limit 1;
output: none //this is a bug.
Realize that the bug is _not_ in SQLite, but in your statement. The test
you put into the statement does _not_ correctly reflect your notion of
"best match" (whatever it is). That's why you get results you don't
expect.
Try
select * from "tbl.7" where '985' like column1||'%' or column1 like
'985%';
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------