On Wednesday, January 22, 2020, srikkanth
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
in this
case.Thanks,Srikanth BFrom: Jan Kohnert
<nospam001-li...@jan-kohnert.de>Sent: Wed, 22 Jan 2020 17:11:56To:
pgsql-general@lists.postgresql.orgSubject: Re: SQL Query Syntax helpHi,Am
Mittwoch, 22. Januar 2020, 12:00:45 CET schrieb srikkanth:[sniped
HTML]something likeselect id, 'Co
On Wed, 22 Jan 2020 at 11:00, srikkanth
wrote:
> Can you please help me in writing the syntax for the below mentioned table.
>
Suggest looking at the crosstab function.
https://www.postgresql.org/docs/current/tablefunc.html
crosstab(text source_sql, text category_sql)
Produces a "pivot
srikkanth wrote:
> Can you please help me in writing the syntax for the below mentioned
This looks like an UNPIVOT operation.
Here's a generic method that does this without having to specify the
columns individually, with the help of json functions:
SELECT ID, key, value FROM
(SELECT
Hi,
Am Mittwoch, 22. Januar 2020, 12:00:45 CET schrieb srikkanth:
[sniped HTML]
something like
select
id, 'Col A' as "Col Name", "Col A" as "Col Value"
from input
union all
select
id, 'Col B' as "Col Name", "Col B" as "Col Value"
from input
...
order by
1, 2;
should work.
--
Kin
On Fri, Nov 22, 2019 at 01:20:59PM +, Zwettler Markus (OIZ) wrote:
> I came up with the following query which should return any apply lag in
> seconds.
>
> select coalesce(replay_delay, 0) replication_delay_in_sec
> from (
>select datname,
> (
> select ca
> The above is not the same format as OP's query:
>
> Update tableA set col1 = null and col2 in (1,2);
I did include set in the sql. I typed it wrong here.
On 4/18/19 11:36 AM, Ravi Krishna wrote:
Not able to produce this with PG 11.1
If col1 is any type other than boolean, the update statement fails in syntax.
If col1 is boolean, then it updated it correctly. In other words
update col1 = NULL
and col2 in (1,2)
is treated same as
upda
"Ravi Krishna"
> To: "Vikas Sharma"
> Cc: pgsql-general@lists.postgresql.org
> Subject: Re: SQL query
>
> Not able to produce this with PG 11.1
>
> If col1 is any type other than boolean, the update statement fails in syntax.
> If col1 is bool
Not able to produce this with PG 11.1
If col1 is any type other than boolean, the update statement fails in syntax.
If col1 is boolean, then it updated it correctly. In other words
update col1 = NULL
and col2 in (1,2)
is treated same as
update col1 = NULL
where col2 in (1,2)
Also
On 4/18/19 11:43 AM, Vikas Sharma wrote:
Hi,
I have come across a query that a developer wrote to update a few rows in
table, the query did update the two desired rows but also updated the
rest of the table with the column value as 'false'.
Update tableA set col1 = null and col2 in (1,2);
T
On 4/18/19 9:43 AM, Vikas Sharma wrote:
Hi,
I have come across a query that a developer wrote to update a few rows
in table, the query did update the two desired rows but also updated the
rest of the table with the column value as 'false'.
Update tableA set col1 = null and col2 in (1,2);
Th
Hello Tom, good evening.
Thank you for your prompt answer and help.
It was enough to ANALYZE the temp tables to achieve a magnificent
result: 37 seconds.
I'm portuguese.
It's a shame you live so far from me. So I can't put a box of bottles of
Porto wine at your door.
I also thank David an
DiasCosta writes:
> This is the query plan for only 19684 rows.
I think you're getting a bad query plan, mostly as a result of two
factors:
* Poor row estimates. It looks like the bottom-most misestimations
are on temp tables, which makes me wonder whether you've ANALYZEd
those tables. Your ap
Hello David and Fabrízio,
The names of the tables and indexes differ from the original script.
Only the names.
This is the query plan for only 19684 rows.
I have another query running for around 3 rows, but it takes an
eternity to finish.
If it finishes in acceptable time I'll make it a
On Wed, Jun 20, 2018 at 3:34 PM, Fabrízio de Royes Mello <
fabri...@timbira.com.br> wrote:
> And use some external service like pastebin.com to send long SQL
> statements.
>
Or just attach a text file - those are allowed on these lists.
David J.
2018-06-20 18:35 GMT-03:00 DiasCosta :
>
> Hi all,
> can someone help me?
>
> I don't know if this is the correct list for this matter. If I'm wrong,
please bear with me and point me in right direction.
>
Here is a good start...
> I have a large query which, largely after more than 24 hours run
17 matches
Mail list logo