Home » Open Source » MySQL » mySQL select statement to PL/SQL select statement
mySQL select statement to PL/SQL select statement [message #252470] Wed, 18 July 2007 23:29 Go to next message
npadilla
Messages: 9
Registered: July 2007
Junior Member
how to 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, Cool = ? 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;
Re: mySQL select statement to PL/SQL select statement [message #252512 is a reply to message #252470] Thu, 19 July 2007 01:26 Go to previous message
Michel Cadot
Messages: 58861
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why do you want to write in PL/SQL a SQL query?

MID is SUBSTR in Oracle SQL.

Next time:
Read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).

Regards
Michel

[Updated on: Thu, 19 July 2007 01:27]

Report message to a moderator

Previous Topic: how to connect from owb to mysql databases
Next Topic: MySQL to PL/SQL
Goto Forum:
  


Current Time: Fri Aug 22 11:33:46 CDT 2014

Total time taken to generate the page: 0.17743 seconds