Re: Change from Postgre to MySQL query error
Thank you Devart, it makes sense to me.
Btw, I have another problem, the original postgres query is below:
UPDATE datavalue AS d1 SET dataelementid=1259, categoryoptioncomboid=1 WHERE dataelementid=1261 and categoryoptioncomboid=1 AND NOT EXISTS ( SELECT * FROM datavalue AS d2 WHERE d2.dataelementid=1259 AND d2.categoryoptioncomboid=1 AND d1.periodid=d2.periodid AND d1.sourceid=d2.sourceid );
Then I changed to this:
UPDATE datavalue AS d1 SET dataelementid=1259, categoryoptioncomboid=1 WHERE dataelementid=1261 and categoryoptioncomboid=1 AND NOT EXISTS ( SELECT * FROM (SELECT * FROM datavalue) AS d2 WHERE d2.dataelementid=1259 AND d2.categoryoptioncomboid=1 AND d1.periodid=d2.periodid AND d1.sourceid=d2.sourceid );
But seems it work forever.
It's great to get you help again! Thank you!
Quang
Subject
Views
Written By
Posted
7452
August 30, 2010 10:45AM
3295
August 31, 2010 02:19AM
Re: Change from Postgre to MySQL query error
3534
September 04, 2010 10:06AM
3626
September 06, 2010 01:18AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.