mySQL select statement to PL/SQL
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,
fld_batch_quota,
fld_REC_quota,
fld_field_quota,
fld_char_quota,
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;