select *
from
id_tb_booking_rate_details,
id_tb_booking_header
where
tbk_reference=tbrd_reference
and tbk_status<>'F'

select * from id_tb_booking_rate_details where tbrd_reference='40520'
and TBRD_STATUS not in ('V','M')
