On 26 May 2016, at 11:44am, Ertan Küçükoğlu <ertan.kucuko...@1nar.com.tr> wrote:

> I need to find a single row in my table which begins as
> the complete card number, or I need to know no match exists in my table.

What happens if two rows match ?

Ignoring that question for a while, what you're looking for is the row which 
sorts immediately before the complete card code you're searching for.

SELECT Kodu FROM FIYATKODLARI WHERE Kodu <= '<searchcode>' ORDER BY Kodu DESC 
LIMIT 1

In your programming langauge take a look at the value returned and see if it is 
the same as the first n characters of the value you're searching for.  If it 
is, you have a match.  If not, you don't.

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

Reply via email to