SELECT t.* FROM (
SELECT ROW_NUMBER() over (order by rs.reserve_cre_dat DESC) as rownum,
rs.reserve_seq as pkCode,
rs.reserve_seq as reserveSeq,
rs.booking_no as bookingNo,
(select r.route_name
from ka_flight f left join ka_route r
on r.route_code = f.flight_from
where f.flight_no = (select s.flight_no
from ka_flight_sche s
where s.flight_sche_seq = rs.sche_from)) as depart,
(select s.flight_no
from ka_flight_sche s
where s.flight_sche_seq = rs.sche_from
and s.flight_no = (select s.flight_no
from ka_flight_sche s
where s.flight_sche_seq = rs.sche_from
and isnull(s.flight_no, '') = 'KND741' ))as flightNo,
convert(varchar, (select s.flight_date
from ka_flight_sche s
where s.flight_sche_seq = rs.sche_from), 103) as departDate,
(select r.route_name
from ka_flight f left join ka_route r
on r.route_code = f.flight_to
where f.flight_no = (select s.flight_no
from ka_flight_sche s
where s.flight_sche_seq = rs.sche_from)) as arr,
convert(varchar, (select s.flight_date
from ka_flight_sche s
where s.flight_sche_seq = rs.sche_to), 103) as arrDate,
convert(varchar, rs.reserve_cre_dat, 103) as reserveDate,
convert(varchar, rs.appointment_dat, 103) as appointmentDate,
convert(varchar(5), rs.appointment_dat, 108) as appointmentTime,
rs.adult_seat as adultSeat,
rs.child_seat as childSeat,
rs.infant_seat as infantSeat,
rs.reserve_name as reserveName,
rs.reserve_phone as reservePhone,
rs.reserve_note as reserveNote,
rs.reserve_status as reserveStatus
FROM ka_reserve rs
WHERE UPPER(rs.reserve_name) LIKE UPPER('%')
AND rs.reserve_type = 'B'
AND rs.reserve_status LIKE '%'
AND convert(varchar, rs.appointment_dat, 103) LIKE '%'
AND convert(varchar, rs.reserve_cre_dat, 103) LIKE '%'
AND UPPER(rs.booking_no) LIKE UPPER('%'))as t