Hi,

try this:

select coalesce(min(length), 0) from t where id = ?

Martin

Andrea Galeazzi schrieb:
> Hi All,
> 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. At 
> this moment the query is too simple:
> SELECT length FROM T WHERE id = ?
> Any idea about it?
> Cheers
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to