Re: SQL Query Syntax help

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: srikkanth <srikkanth16081991(at)rediffmail(dot)com>
Cc: Jan Kohnert <nospam001-lists(at)jan-kohnert(dot)de>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: SQL Query Syntax help
Date: 2020-01-22 15:34:17
Message-ID: CAKFQuwYRhY8sXZDv3+=OV1MztXAMBK4rUiczxqbUjF=Smxjxkg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On Wednesday, January 22, 2020, srikkanth <srikkanth16081991(at)rediffmail(dot)com>
wrote:

> Hi Jan,
>
> Thanks for your input, it is working exactly what i want, but still i m
> facing issue because in my table there are different data types they are 10
> to 15 columns are Boolean, one primary key, 140 columns are character.
>
> when i m applying the logic on this scenario i m getting the below error.
>
> ERROR: UNION types boolean and character cannot be matched
> LINE 10: ..._ID","Critical_Decision" as col_Name, "Critical_... ^
> SQL state: 42804
> Character: 585
>
> After applying the logic i need to take this data into the table.
>
> can you please help me how to write the syntax in this case.
>

Cast everything to text?

https://www.postgresql.org/docs/12/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS

David J.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message soumik.bhattacharjee 2020-01-23 15:39:20 pg_rewind
Previous Message srikkanth 2020-01-22 12:07:23 Re: SQL Query Syntax help

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-01-22 16:14:51 Re: PostgresSQL 10 on remote server - Socket is not connected (0x00002749/10057)
Previous Message Justin 2020-01-22 14:23:10 Re: @@TRANCOUNT ?