select * from user_tag a where `code`='LJ_002' and is_deleted =0 and
'LJ_001' not in (select code from user_tag where id <> a.id and user_id = a.user_id and is_deleted =0)
select * from user_tag a where type='LJ_002' and 'LJ_001'=(select code from user_tagwhere id>a.id order by id limit 1)