You can try the following code:
select tableAB.a, tableP.a
from table as tableAB
inner join table as tableP on tableAB.b = tableP.b
where tableAB.a = '00AB'
and tableP.a != '00AB'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.