migrating oracle joins to mysql
Posted by: Minal Bhadle
Date: July 02, 2009 06:32AM

Hello friends , i m trying to convert following oracle query to mysql one..It is giving syntax error ..Oracle query is :


SELECT sum(p_numofrasname) as p_numofrasname, sum(nvl(p_numof1stareacnt,0)) as p_numof1stareacnt, sum(nvl(p_numof2stareacnt,0))+sum(nvl(p_numof1stareacnt,0)) as p_numof2stareacnt
FROM
(
SELECT acr_id as ne_name, count(*) as p_numofrasname
FROM CALL_T_PAGING_GROUP_WSM
WHERE pgroup_id=1 group by acr_id) a,
(
SELECT acr_id as ne_name, count(*) as p_numof1stareacnt
FROM CALL_T_PAGING_GROUP_WSM
WHERE pgroup_id=1 and sub_pgroup_id = 1 group by acr_id ) b,
(
SELECT acr_id as ne_name, count(*) as p_numof2stareacnt
FROM CALL_T_PAGING_GROUP_WSM
WHERE pgroup_id=1 and sub_pgroup_id = 2 group by acr_id)c

WHERE a.ne_name=b.ne_name(+) and a.ne_name=c.ne_name(+)

Options: ReplyQuote


Subject
Written By
Posted
migrating oracle joins to mysql
July 02, 2009 06:32AM


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.