Сообщения

Сообщения за Январь, 2015

Postgres UPSERT

UPDATE"SC_Wonder"."TMining_New"SET"FH_09_Q"=100,"FH_09_Fe"=20,"FH_09_ZnO"=0,"FH_09_S"=0WHERE"FMineObj_ID"=7AND"FDate"='2015-01-28';INSERTINTO"SC_Wonder"."TMining_New"("FDate","FMineObj_ID","FH_09_Q","FH_09_Fe","FH_09_ZnO","FH_09_S")SELECT'2015-01-28',7,100,20,0,0WHERENOTEXISTS(SELECT1FROM"SC_Wonder"."TMining_New"WHERE"FMineObj_ID"=7AND"FDate"='2015-01-28');

Postgres изменение типа поля

HINT:  Specify a USING expression to perform the conversion.

ALTER TABLE "SC_Wonder"."TMIneObj_New" ALTER COLUMN "F_Correct" TYPE integer USING ("F_Correct"::integer);