0

Converting ms sql to postgresql. The issue i am having is that it doesn't seem to like the keyword "as"

eg with,

rtrim(to_char(a.eff_dt,'MM/DD/YYYY')) as 'Execution Date'

it doesn't like " as 'Execution Date'".

does anybody know a postgresql way to make this work?

thanks

    select distinct
        rtrim(to_char(a.eff_dt,'MM/DD/YYYY')) as 'Execution Date',
        rtrim(a.status) as 'Status',
        rtrim(a.agreement_type) as 'Agreement Type',
        rtrim(a.agreement_id) as 'Agreement ID',
        rtrim(a.portfolio_name) as 'Aladdin Portfolio',
        '="'+rtrim(a.fund_id)+'"' as 'FCM Clearing ID',
        rtrim(a.loc) as 'FCM',
        str_replace(a.name, ',', ' ') as 'Executing Broker',
        rtrim(b.level1_cd)
        from t$temp5 a, fr_dcode b
        where a.executing_cpty_code*=b.level2_cd
        --where a.name=b.value
        order by eff_dt  desc, agreement_id, portfolio_name, fund_id, loc, name;
jack gell
  • 175
  • 1
  • 8
  • 4
    [As documented in the manual](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS) identifiers use double quotes (`"`) in SQL. Single quotes are used for string constants. –  Oct 25 '22 at 08:54

0 Answers0