with a as (
select 1 as id, 'name1'as name
union
select 2 as id, 'name2'as name
union
select 3 as id, 'name3'as name
union
select 4 as id, 'name4'as name
union
select 5 as id, 'name5'as name
)
,b as (
select 1 as id, 'name10b'as name
union
select 2 as id, 'name2b'as name
union
select 3 as id, 'name30b'as name
union
select 4 as id, 'name40b'as name
union
select 5 as id, 'name5b'as name
)
select * from a left join b
on a.id=b.id
and b.id > 2