On Sep 15, 2014, at 7:08 PM, Hick Gunter wrote:
> Maybe you can reformulate the query to fit
>
> INSERT OR UPDATE INTO t SELECT t.a,t.b,...,s.x,s.y FROM t, s …
There is no such a thing as 'INSERT OR UPDATE’ in SQLite. There is a ‘REPLACE’,
but it’s definitively not the same as an update.
An
Maybe you can reformulate the query to fit
INSERT OR UPDATE INTO t SELECT t.a,t.b,...,s.x,s.y FROM t, s ...
-Ursprüngliche Nachricht-
Von: Mark Lawrence [mailto:no...@null.net]
Gesendet: Montag, 15. September 2014 10:51
An: sqlite-users@sqlite.org
Betreff: [sqlite] SET (x,y) = (x1,y1
On Mon, Sep 15, 2014 at 10:21 AM, Dennis Jenkins
wrote:
> This construct does not work in postgresql 9.3.5 (unless I have a typo).
>
> However, I would love for it to work in both Postgresql and Sqlite.
>
>
> djenkins@ostara ~ $ psql -Upostgres -dcapybara_regtest
> psql (9.3.5)
> Type "help" for h
This construct does not work in postgresql 9.3.5 (unless I have a typo).
However, I would love for it to work in both Postgresql and Sqlite.
djenkins@ostara ~ $ psql -Upostgres -dcapybara_regtest
psql (9.3.5)
Type "help" for help.
capybara_regtest=# create table test1 (col1 integer, col2 intege
On Mon Sep 15, 2014 at 10:51:04AM +0200, Mark Lawrence wrote:
>
> Normally one could use a CTE to do the work once:
>
> WITH
> cte
> AS (
> SELECT 1 AS x, 2 AS y
> )
> UPDATE
> t
> SET
> x = cte.x,
> y = cte.y
> ;
Actually t
I occasionally have the need to update two columns based on complex sub
queries, which are often very similar
UPDATE
t
SET
x = ( SELECT 1...),
y = ( SELECT 2...)-- nearly the same as SELECT 1
;
Normally one could use a CTE to do the work once:
WITH
6 matches
Mail list logo