select LINE_CODE,MOVE_TYPE,MOVE_DATE,SHEET_ID,TOTAL_SHEET_JUDGE,TOTAL_PIECE_JUDGE,LOT_NO from RPL_inout_sheet_result where to_date(MOVE_DATE, 'YYYY/MM/DD HH24:MI:SS') > to_date('2014/05/12 0:0:0', 'yyyy/mm/dd hh24:mi:ss') and to_date(MOVE_DATE, 'YYYY/MM/DD HH24:MI:SS') < to_date('2014/05/12 23:0:0', 'yyyy/mm/dd hh24:mi:ss') GROUP BY LINE_CODE,MOVE_TYPE,MOVE_DATE,SHEET_ID,TOTAL_SHEET_JUDGE,TOTAL_PIECE_JUDGE,LOT_NO