On Sun, Jun 20, 2010 at 3:47 PM, Sam Carleton
<scarle...@miltonstreet.com> wrote:
> Erin and Igor,
>
> I simply cannot wrap my head around the correct syntax.  BAsed on the
> documentation, I believe I should be looking to make it fit this
> pattern:
>
> CASE WHEN x=w1 THEN r1 WHEN x=w2 THEN r2 ELSE r3 END
>
> Does the WHERE clause get replaced with the WHEN clause like this:

No. WHERE clause is a completely different part of the statement,
different from WHEN which is a part of the CASE construct. "CASE..
WHEN .. THEN .. ELSE .. END" is one construct, an expression, and
applies to the columns, while WHEN is a completely different part.


>
> CASE SELECT FolderId, ImageId, instertedon
>  FROM V_FAVORITES_SELECTED
>  WHEN instertedon > julianday(@time)
>  THEN findImage(@rootPath, FolderId, ImageId) ELSE 0 END;
>
>
> On Sun, Jun 20, 2010 at 12:02 PM, Erin Drummond <erin....@gmail.com> wrote:
>> You missed the "case when" part.
>> See "The CASE Expression" : http://www.sqlite.org/lang_expr.html
>>
>> On Mon, Jun 21, 2010 at 2:28 AM, Sam Carleton
>> <scarle...@miltonstreet.com> wrote:
>>> Igor,
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to