In sql server, how do I query whether the field in Table An is included in a field in Table B?

has the following two tables:

Table a field:

id,tag

Table b field:

id,title

< H2 > query purpose: < / H2 >

when the tag of table an is contained in the title of table b, it is queried

< H2 > the current code looks something like this: < / H2 >

select a.tag from a with (nolock)
left outer join b with (nolock)
on charindex (a.tagg, b.title) > 0

< H2 > question: < / H2 >

according to my code, it takes a long time to execute. Is there a better way to write it? Thank you!

Jul.22,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c763-2c343.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c763-2c343.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?