"Mahalakshmi.m"
<[EMAIL PROTECTED]> wrote
in message
news:[EMAIL PROTECTED]
> Rowid Id Album
> 1 4 aaaa
> 2 3 cccc
> 3 2 dddd
> 4 1 eeee
>
> SELECT rowid,Album FROM Temp WHERE Album like 'c%';
> Output: rowed -> 2 and Album -> cccc
>
> My doubt is for this statement
> "SELECT rowid , Album FROM Temp WHERE Album like 'b%'; " I am not
> having any Album with match pattern starting with b so I want the
> rowed and Album for the string next to the provided ie, rowed ->3
> and Album -> cccc.

select rowid, album from temp
where album >= 'b' collate nocase
order by album limit 1;

That should work both when there is and isn't a match.

Igor Tandetnik 



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

Reply via email to