Andrea Galeazzi wrote:
> I've got a table T made up of only two fields: INT id (PRIMARY KEY) and
> INT length.
> I need a statement in order to yield 0 when the key doesn't exist.

Well, "select 0;" fits your spec (you never said what should be returned when 
the key does exist). I would hazard a guess that you meant something like this:

select coalesce((select length from T where id=?), 0);

-- 
Igor Tandetnik

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

Reply via email to