INSERT IGNORE INTO meta.itineraryPlaces(`GDS_LCC`,`PNR`,`TktNumber`,`Fare_Construction`,`Timestamp`,`ClassOfBooking`) 
SELECT GDS_LCC,PNR, TktNumber, Fare_Construction, `Timestamp`,`Cabin_Class` FROM PNR_Trigger.PNR_Ticket_Details WHERE IFNULL(Fare_Construction,'') <> '' AND GDS_LCC = 'GDS' AND DATE(`Timestamp`) = CURDATE() AND CouponNum = '1' GROUP BY PNR,Fare_Construction ORDER BY DATE(`Timestamp`) DESC, PNR ASC, TktNumber ASC;

INSERT IGNORE INTO meta.segmentDetails(`PNR`,`TktNumber`,`Coupon`,`Origin`,`Destination`,`Airline`,`CabinClass`,`RBD`,`DateOfDeparture`,`TimeOfArrival`)
SELECT PNR, TktNumber, IFNULL(CouponNum,'1'), Dep_Airport,Arr_Airport,Airline_Code, Cabin_Class, BIC,CONCAT(DATE(Dep_Date),' ', IFNULL(Start_Time,'')), IFNULL(Arr_Time,'') FROM PNR_Trigger.PNR_Ticket_Details WHERE  DATE(`Timestamp`) = CURDATE() ORDER BY PNR ASC,TktNumber ASC, CONCAT(Dep_Date, Start_Time) ASC;

