Richard Hipp <d...@sqlite.org> wrote: > On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton > <scarle...@miltonstreet.com>wrote: > >> Forgive me, fore I have forgotten the term used to describe the behavior if >> a C if statement where it stops executing on the first false statement, >> but... Does coalesce do that? >> > > "Short-circuit evaluation" is the usual term applied to this kind of thing, > and yes, COALESCE() does short-circuit evaluation. If you say > "coalesce(A,B)" and A is not NULL than B is never evaluated, which can be a > significant performance win if, for example, B is a complex subquery.
When did this start, with what SQLite version? I must admit I'm somewhat behind (using 3.6.X for some X I don't recall at the moment), but in the version I use, in expression coalesce(someField, customFunction()) I definitely see customFunction() called even when someField is not null. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users