MySQL Forums
Forum List  »  Oracle

mySQL select statement to PL/SQL
Posted by: Nelson Padilla
Date: July 18, 2007 10:30PM

How do you write this in PL/SQL format?

SELECT Prj.fld_Name as `Project Name`, V.fld_Name as `Version`, date(P.fld_date) as `DATE`,
S.fld_name as `STEP`,
U.fld_Name as `User Name`,
P.fld_batch_ID) as `BATCHES`,
sum(fld_rec_count) as `RECORDS`,
sum(fld_field_count) as `FIELDS`,
sum(fld_char_count) AS `CHARACTERS`,
fld_Duration as HOURS,
sum(fld_char_count) / sum(fld_Duration) as SPEED,
FROM db_proj_mngr.tbl_Productivity P
LEFT JOIN db_proj_mngr.tbl_user U
ON P.fld_user_id=U.fld_user_id
LEFT JOIN db_proj_mngr.tbl_Step S
ON MID(P.fld_step_ver_id, 9,2)=S.fld_step_id
LEFT JOIN db_proj_mngr.tbl_Project Prj
ON MID(P.fld_step_ver_id, 1,4)=Prj.fld_proj_id
LEFT JOIN db_proj_mngr.tbl_Version V
ON MID(P.fld_step_ver_id, 1, 8)=V.fld_ver_id
LEFT JOIN db_proj_mngr.tbl_step_of_version STV
ON STV.fld_step_ver_id = P.fld_step_ver_id
Where MID(P.fld_step_ver_id, 1,4)=? AND MID(P.fld_step_ver_id, 1, 8) = ? AND
date(fld_date) between ? AND ?
GROUP BY Prj.fld_Name, V.fld_Name, date(P.fld_date), S.fld_name, P.fld_user_id
ORDER BY Prj.fld_Name, V.fld_Name, date(P.fld_date), S.fld_name, P.fld_user_id;

Options: ReplyQuote

Written By
mySQL select statement to PL/SQL
July 18, 2007 10:30PM

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.