Created
January 21, 2011 10:52
-
-
Save LauJensen/789530 to your computer and use it in GitHub Desktop.
First cut at interface for CASE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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