SELECT distinct (t1.pnr),
t1.FLT_NUM AS FLT,
t1.FLT_LEG_DEP_DAT AS DEPDATE,
t1.FLT_LEG_DEP_STN AS ORG,
t1.FLT_LEG_ARR_STN AS DES,
t1.CUST_FST_NAME AS FRSTNAME,
t1.CUST_LST_NAME AS LASTNAME,
t1.HIST_EVT_SERVICE AS TRANSACTION,
t1.EVT_HIST_CATG AS CATEGORY,
t1.EVT_HIST_SUBCATG AS SUBCATEGORY,
t1.HIST_REFERENCE_DET AS REFRANCE,
t1.HIST_LAT_UPD AS HISTRANSLAT,
t1.AGT_OFF_ID AS OFFICEID,
t1.AGT_SIGN_CD AS SIGNCD,
t1.AGT_USR_ID AS USERID
FROM MKD.TCUBGHIS t1
Left join MKD.TCUBGHIS t2
ON T1.PNR = T2.PNR
AND T1. FLT_LEG_DEP_DAT = T2. FLT_LEG_DEP_DAT
AND T1. FLT_NUM = T2. FLT_NUM
AND T1. FLT_LEG_DEP_STN = T2. FLT_LEG_DEP_STN
AND T1. FLT_LEG_ARR_STN = T2. FLT_LEG_ARR_STN
WHERE t1.FLT_date = '20130925'
and t2.FLT_date = '20130925'
--WHERE t1.FLT_date > '20130501' and t1.FLT_date < '20130508')
--and (t2.FLT_date > '20130501' and t2.FLT_date < '20130508')
--WHERE trunc(t1.FLT_date) = '201305'
--and trunc(t2.FLT_date) = '201305'
--and t1.flt_num = '0303'
--and t2.flt_num = '0303'
and t1.EVT_HIST_CATG = 'CPR Ticket'
and t1.EVT_HIST_SUBCATG = 'PTK-Paper Ticket'
AND t1.AGT_OFF_ID <> ' '
and t2.EVT_HIST_SUBCATG = 'BRD-Customer Boarding'
and t2.hist_lat_upd like '%BRDS-B%';
the FLT_DATE IS INDEX AND I NEED THE REPORT BY MONTH FROM THIS FLT_DATE I DONOT NEED THE DAYS
YOU MAY SEE ABOVE I TRAIED WITH COMMENTD LINES BUT IT HANGS AND IT TAKE LONG TIME WITH NO ACTION
KINDLY COULD HELP ME IN OVERCOME THIS THANKS VERY MUCH IN ADVNCE WAITING YR REPLY HERYY UP PLEASE.........MOHAMMED
asked
Nov 11 '13 at 18:53
MOHD17288
0●1●1●1
Please read "What if I don't get an answer?" in the FAQ: http://ask.use-the-index-luke.com/faq/
Although your question seems to be on-topic, the way you present it does not motivate me to spend my time on answering it. Sorry.