Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hoeck
Forked from LauJensen/gist:789530
Created January 21, 2011 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoeck/789596 to your computer and use it in GitHub Desktop.
Save hoeck/789596 to your computer and use it in GitHub Desktop.
(project (table :t1)
[:id :title]
(case :alias??
(<= :wage 200)
"low"
(and (> :wage 200) (< :wage 400))
"average"
(>= :wage 400)
"high"
:else "negative"))
"SELECT id,title,
CASE WHEN (wage <= 200) THEN low
WHEN (wage > 200 AND wage < 400) THEN average
WHEN (wage >= 400) THEN high
ELSE
negative
END AS alias
FROM t1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment