MySQL Forums
Forum List  »  PostgreSQL

Re: Change from Postgre to MySQL query error
Posted by: Quang Nguyen
Date: September 04, 2010 10:06AM

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

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Change from Postgre to MySQL query error
3082
September 04, 2010 10:06AM


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.