Created
September 11, 2015 15:05
-
-
Save gothedistance/43eae754c3a2e8b0706e to your computer and use it in GitHub Desktop.
PostgreはJOIN句に式を書ける
This file contains hidden or 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
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