Skip to content

Instantly share code, notes, and snippets.

@gothedistance
Created September 11, 2015 15:05
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 gothedistance/43eae754c3a2e8b0706e to your computer and use it in GitHub Desktop.
Save gothedistance/43eae754c3a2e8b0706e to your computer and use it in GitHub Desktop.
PostgreはJOIN句に式を書ける
select
c.customer_id,
c.customer_age,
c.customer_name,
ca.name,
ca.rank
from
customers as c
inner join customer_category as ca
on (c.customer_age /5 *5) = ca.rank
where
c.customer_id <= 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment