mysql - Need to access field of a table which is defined by a condition -
i need access field of database table defined condition in query.i need access service_leg column , filter data column.
select pa1.countryname, pw.serviceprovideractorwid, pa2.id, pw.orderid, pw.issorderref, po.modelcode, pw.itemid, pe1.eventcode starteventcode, pe2.eventcode endeventcode, case when pw.enddate < pof.retdate 'to_service' else 'from service' end "service_leg", pa1.roleid, pad.activitycode, pw.tat, pw.totelapse phwactivitydetail pw join phdactor pa1 on pa1.actorwid = pw.orderissactorwid join phdactor pa2 on pa2.actorwid = pw.serviceprovideractorwid join phdobject po on po.objectwid = pw.objectwid join phdevent pe1 on pe1.eventwid = pw.starteventwid join phdevent pe2 on pe2.eventwid = pw.endeventwid join phaorderflowcatch pof on pof.orderdid = pw.orderdid join phxactivitydef pad on pad.activitydefdid = pw.activitydefdid join gldcalendar gc on gc.datenum = pw.enddatenum;
thank you.
use outer sub-query
achieve that.
demo:
select * ( select pa1.countryname, pw.serviceprovideractorwid, pa2.id, pw.orderid, pw.issorderref, po.modelcode, pw.itemid, pe1.eventcode starteventcode, pe2.eventcode endeventcode, case when pw.enddate < pof.retdate 'to_service' else 'from service' end "service_leg", pa1.roleid, pad.activitycode, pw.tat, pw.totelapse phwactivitydetail pw join phdactor pa1 on pa1.actorwid = pw.orderissactorwid join phdactor pa2 on pa2.actorwid = pw.serviceprovideractorwid join phdobject po on po.objectwid = pw.objectwid join phdevent pe1 on pe1.eventwid = pw.starteventwid join phdevent pe2 on pe2.eventwid = pw.endeventwid join phaorderflowcatch pof on pof.orderdid = pw.orderdid join phxactivitydef pad on pad.activitydefdid = pw.activitydefdid join gldcalendar gc on gc.datenum = pw.enddatenum ) t t.service_leg > 100;
Comments
Post a Comment