Oracle Select Statement to MYSQL
Hi to All. I'm trying to convert this Statement to MYSQL but at this moment I'm being unable to perform it. THis is the query
select round(to_number((TO_DATE(SUBSTR(l.REVISIONDATE, 0, 8), 'YYYYMMDD HH24MISS')) - (TO_DATE(SUBSTR(a.ORIGINATEDDATE, 0, 8), 'YYYYMMDD HH24MISS'))),2) as Days_In_PRB, sum(l.quantity) from fw.CAT_PRB a, fw.cat_prb_lot l where l.prrnumber = a.prrnumber and a.ORIGINATEDDATE between ('date1') and ('date2') group by round(to_number((TO_DATE(SUBSTR(l.REVISIONDATE, 0, 8), 'YYYYMMDD HH24MISS')) - (TO_DATE(SUBSTR(a.ORIGINATEDDATE, 0, 8), 'YYYYMMDD HH24MISS'))),2) order by round(to_number((TO_DATE(SUBSTR(l.REVISIONDATE, 0, 8), 'YYYYMMDD HH24MISS')) - (TO_DATE(SUBSTR(a.ORIGINATEDDATE, 0, 8), 'YYYYMMDD HH24MISS'))),2) asc
The problem is when using the functions to_number and to_date. Can anyone help me????