MySQL Forums
Forum List  »  Oracle

How to convert some Oracle to MYSQL Queries
Posted by: Luisa Schulze
Date: May 08, 2012 02:51AM

Hello,
i want to convert Oracle Queries to MYSQL Queries, but i have problems with some of them.

The Queries are like this:

1) MERGE INTO tab1 d1
USING tab d2
ON (d1.id = d2.id)
WHEN MATCHED THEN
UPDATE SET d1.zufriedenheit = 'Merge Update'
WHEN NOT MATCHED THEN
INSERT (d1.id, d1.typ, d1.active, d1.zufriedenheit)
VALUES (d2.id, d2.typ, d2.dpr_scd_active,'Merge Insert');


2) SELECT
REGEXP_REPLACE(tab1, '(.)', '\1 ') "REGEXP_REPLACE",
REGEXP_SUBSTR(tab1,'([[:alnum:]]+\.?){3,4}/?') "REGEXP_SUBSTR", tab2
FROM tab2
WHERE REGEXP_LIKE (tab2, '([8])\1', 'i');


3) SELECT *
FROM
(select tab1, tab2, avg(tab3),
DENSE_RANK() OVER ( PARTITION BY tab1 ORDER BY(tab3)) as Rang
FROM
.
.
.
where Rang < 11
..;


4) SELECT * FROM (
......)
WHERE rownum <= 100;
(I have found a alternative for rownum, but with the constraint rownum <= 100 it doesn´t work.)


5) SELECT tab1, tab2,
SUM(tab2) OVER (PARTITION BY tab1) as res1,
tab3,
SUM(tab3) OVER (PARTITION BY tab1) as res2,
tab4,
SUM(tab4) OVER (PARTITION BY tab1) as res3,
from (
.
.
.



Maybe you can help me with some of them.

Options: ReplyQuote


Subject
Views
Written By
Posted
How to convert some Oracle to MYSQL Queries
5680
May 08, 2012 02:51AM


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.