mysql查询

 

 

2. 子查询

select i.shotel_id, i.mhotel_id, i.hotel_name, o.hotel_id, o.hotel_name
from ebooking_shotel_info i
left join ebooking_search_order o
on i.shotel_id = o.hotel_id
where i.shotel_id not in (select distinct hotel_id from ebooking_search_order)
;

 

1. left join  以左表为基础

select s.hotel_id, s.hotel_name, i.province_name
from ebooking_search_order s left join ebooking_shotel_info i
on s.hotel_id = i.shotel_id
where province_name like '北%'
limit 0, 100
;

posted @ 2017-08-23 17:35  Python_ZEN  阅读(125)  评论(0编辑  收藏  举报