"Alexey Pechnikov" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> select * from direction_telephony
> where prefix in
> ('78312604812','7831260481','783126048','78312604','7831260','783126','78312','7831','783','78','7')
> order by length(prefix) desc
> limit 1;

select * from direction_telephony
where prefix != '' and '78312604812' LIKE prefix || '%'
order by length(prefix) desc
limit 1;

Or

where prefix=substr('78312604812', 1, length(prefix))

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to