Created
December 22, 2011 04:25
-
-
Save axiak/1508915 to your computer and use it in GitHub Desktop.
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 distinct | |
<include refid="t_fact_columns_fragment" /> | |
from | |
t_fact fct, | |
t_location_fact locf, | |
t_user_location uloc, | |
t_location loc | |
where | |
fct.fact_pk = locf.fact_pk and | |
loc.location_id = locf.location_id and | |
loc.location_active = 'Y' and | |
uloc.location_id(+) = locf.location_id and | |
uloc.user_pk(+) = ${user_pk} | |
group by | |
<include refid="t_fact_columns_fragment" /> | |
having | |
-- DANGER - This line is slightly subtle. Do not change unless | |
-- you understand what it is trying to do. | |
min(decode(uloc.active_flag, 'Y', 1, 0)) = 1 | |
order by | |
fct.short_fact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment