On Mon, Oct 26, 2009 at 7:58 AM, Igor Tandetnik <[email protected]> wrote:


> and then in your host app check for negative values and treat them as zero.
> Or, if you insist on doing that in SQL:
>
> select (case when c > 0 then c else 0 end) from
> (SELECT COUNT(title) - 5 as c FROM tracks
>  WHERE singer='Madonna'
>   AND title<:firsttitle);


Igor,

You are always right on the mark, thank you!  The only minor change I will
make is to the 'else 0', change it to ' else 5 + c', getting the accurate
conceptual index of the first entry.

Sam
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to