Skip to content

Instantly share code, notes, and snippets.

@nastajus
Last active November 9, 2015 20:01
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 nastajus/c1968428d9dd7bea2297 to your computer and use it in GitHub Desktop.
Save nastajus/c1968428d9dd7bea2297 to your computer and use it in GitHub Desktop.
select
cco.option_code, substr(cco.option_code, 18) pt_code, pt.payment_type_id, pt.PAYMENT_TYPE_CODE, pt.PAYMENT_TYPE_DESCRIPTION
from psec_client_config_option cco, paycfg_payment_type pt
where substr(cco.option_code, 18) = pt.payment_type_id
and cco.option_code like 'ACCOUNT_PATTERN%'
and cco.client_code = ( select client_code from psec_client where short_name = upper('cott'))
order by pt_code;
@nastajus
Copy link
Author

nastajus commented Nov 9, 2015

this is dumb, i can't use the alias pt_code on line 4. i have to repeat substr(cco.option_code, 18) instead. if i try to use the alias, i get this error:

ORA-00904: PT_CODE: invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 3 Column: 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment