SELECT L.LOTID AS ""Run Card Lot ID"",
       L.Workorder AS ""Work Order ID"",
       L.Qty AS ""Lot Qty(pcs)"",
       L.Qty2 AS ""Lot Qty(Wafer pcs)"",
       L.Status AS ""Run Card Status"",
       L.HOLDREASONNAME AS ""Hold Reason"",
       L.CurrentHoldCount AS ""Hold Count"",
       L.Owner AS ""Work Order Owner"",
       L.StartDate AS ""Run Card Start Date"",
       L.UTS,
       L.Product AS ""Product P/N"",
       L.Productlinename AS ""Package"",
       L.Package_LEF as ""Package(LF)"",
       L.PJ_FUNCTION AS ""Product Function"",
       L.Pj_Type AS ""Product Type"",
       L.BOP,
       L.FirstName AS ""Wafer Lot ID"",
       L.WAFERNAME AS ""Wafer P/N"",
       L.WaferLot ""Wafer Lot ID(Prefix)"",
       L.SpecName AS ""Spec"",
       L.SPECSEQUENCE AS ""Spec Sequence"",
       L.SPECSEQUENCE || '_' || L.SpecName AS ""Spec(Order)"",
       L.Workcentername AS ""Work Center"",
       L.WorkCenterSequence AS ""Work Center Sequence"",
       L.WorkCenter_Group AS ""Work Center(Group)"",
       L.WorkCenter_Short AS ""Work Center(Short)"",
       L.WorkCenterSequence_Group AS ""Work Center Sequence(Group)"",
       L.WorkCenterSequence_Group || '_' || L.WorkCenter_Group AS ""Work Center Group(Order)"",
       L.AgeByDays AS ""Age By Days"",
       L.Equipments AS ""Equipment ID"",
       L.EquipmentCount AS ""Equipment Count"",
       L.Workflowname AS ""Work Flow Name"",
       L.Datecode AS ""Product Date Code"",
       L.LEADFRAMENAME AS ""LF Material Part"",
       L.LEADFRAMEOPTION AS ""LF Option ID"",
       L.COMNAME AS ""Compound Material Part"",
       L.LOCATIONNAME AS ""Run Card Location"",
       L.Eventname AS ""NCR ID"",
       L.Occurrencedate AS ""NCR-issued Time"",
       L.ReleaseTime AS ""Release Time"",
       L.ReleaseEmp AS ""Release Employee"",
       L.ReleaseReason AS ""Release Comment"",
       L.COMMENT_HOLD AS ""Hold Comment"",
       L.CONTAINERCOMMENTS AS ""Comment"",
       L.COMMENT_DATE AS ""Run Card Comment"",
       L.COMMENT_EMP AS ""Run Card Comment Employee"",
       L.COMMENT_FUTURE AS ""Future Hold Comment"",
       L.HOLDEMP AS ""Hold Employee"",
       L.DEPTNAME AS ""Hold Employee Dept"",
       L.PJ_PRODUCEREGION AS ""Produce Region"",
       L.Prioritycodename AS ""Work Order Priority"",
       L.TMTT_R AS ""TMTT Remaining"",
       L.wafer_factor AS ""Die Consumption Qty"",
       Case When (L.EquipmentCount>0) Then 'RUN'
            When (L.CurrentHoldCount>0) Then 'HOLD'
            ELSE 'QUENE' End AS ""WIP Status"",
       Case When (L.EquipmentCount>0) Then 1
            When (L.CurrentHoldCount>0) Then 3
            ELSE 2 End AS ""WIP Status Sequence"",
       sys_date AS ""Data Update Date""