Skip to content

Instantly share code, notes, and snippets.

@LauJensen
Created January 21, 2011 10:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save LauJensen/789530 to your computer and use it in GitHub Desktop.
Save LauJensen/789530 to your computer and use it in GitHub Desktop.
First cut at interface for CASE
clojureql.core> (project (table :t1)
[:id (case :wages
(<= :wage 5) "low"
(>= :wage 10) "high"
:else "average")])
SELECT t1.id,CASE
WHEN (wage <= 5) THEN low
WHEN (wage >= 10) THEN high
ELSE average
END AS wages
FROM t1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment