🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
`left semi join`同`in`是一样的效果。 ```sql select * from left_tbl lt left semi join right_tbl rt on lt.id=rt.id; +--------+----------+---------+--+ | lt.id | lt.name | lt.age | +--------+----------+---------+--+ | 1 | 张三 | 20 | | 2 | 李四 | 22 | +--------+----------+---------+--+ select * from left_tbl lt where lt.id in(select id from right_tbl); +--------+----------+---------+--+ | lt.id | lt.name | lt.age | +--------+----------+---------+--+ | 1 | 张三 | 20 | | 2 | 李四 | 22 | +--------+----------+---------+--+ ```