[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] Like operator
From:       "Igor Tandetnik" <itandetnik () mvps ! org>
Date:       2008-02-28 5:12:33
Message-ID: fq5g6n$fr$1 () ger ! gmane ! org
[Download RAW message or body]

"Mahalakshmi.m"
<mahalakshmi.m@jasmin-infotech.com> wrote
in message
news:200802280356.m1S3udnv020339@linuxmail.jasmin-infotech.com
> 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic