Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select *
- from hotel_region_autocomplete
- where
- region_id in (
- select distinct(region_id) from
- (select distinct(region_id)
- FROM
- (select region_id, region_name from hotel_region_autocomplete where (region_group = 'C' or region_group = 'A') and suggestion_name REGEXP CONCAT('[[:<:]]', "Indonesia", '[[:>:]]')
- and region_id not in (select region_id from hotel_ean_city_code_region_id_mapping)) as cmd
- where cmd.region_id not in (select temp.region_id from
- (select * from hotel_region_autocomplete where (region_group = 'C' or region_group = 'A') and suggestion_name REGEXP CONCAT('[[:<:]]', "Indonesia", '[[:>:]]')
- and region_id not in (select region_id from hotel_ean_city_code_region_id_mapping)) as temp
- join
- (select m.region_id, h.child_ids from hotel_ean_child_regions as h
- join hotel_ean_city_code_region_id_mapping as m on h.region_id = m.region_id) as twd
- on twd.child_ids REGEXP CONCAT('[[:<:]]',temp.region_id, '[[:>:]]'))) as indo
- join (select child_ids from hotel_ean_child_regions where region_id = '602651') as child
- on child.child_ids NOT REGEXP CONCAT('[[:<:]]',indo.region_id, '[[:>:]]')
- where indo.region_id != '602651');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement