Search Postgresql Archives

Re: how to do merge in postgres ("with upsert as" not supported)

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

 



Tong Michael schrieb am 26.02.2015 um 21:23:
> 
> hey, guys, I came across a merge statement when I'm trying to convert stored procedures from Mysql to Postgres:____
> 
> __ __
> 
> merge into db.ChargePeriod d____
> using (____
>     select ba.ClientID____
> ...
> ...

That can't be MySQL - MySQL does not have a MERGE statement. 
That looks much more like SQL Server's T-SQL (MERGE, @ style variables, convert() function...)

Here are several ways to do it: http://stackoverflow.com/q/1109061/330315

> I saw some people use "with upsert as", but my pgAdmin version(1.8) doesn't support it. 

pgAdmin supports whatever your Postgres version supports. 
All supported/maintained Postgres versions support common table expressions.

What exactly do you mean with "doesn't support it"? What was the exact SQL statement you tried? 





-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[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 Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux