Search Postgresql Archives

Re: How to set alias data type?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 24, 2021 at 01:57:06PM +0000, Shaozhong SHI wrote:
> select 'Total' as Total generate result that set Total as a column name
> with unknown type
> 
> When trying to cast
> select 'Total' as Total:: text

You need to cast value, and not name.

select 'Total'::text as Total;

Best regards,

depesz






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux