如何在查询中更改日期格式以及排序

时间:2019-03-14 08:25:19

标签: postgresql date to-char

这是我的查询,我想将日期格式转换为“ HH:MI am,DD Month YYYY”,并且应该升序

with  a1 as (
    select
        replace(ccfd.comments, ',', '!@#$%'),
        uu.fname,
        ccfd.create_date
    from 
        revenue_accounting.cpu_comment_form_details as ccfd
    left join 
        users.users as uu on uu.id = ccfd.updated_by
    where 
        ccfd.cpu_form_id = 1762
    order by 
        ccfd.create_date
)
select 
    array_to_string(array_agg(array[fname,replace,create_date::text]::text),',') from a1

0 个答案:

没有答案