I was going to share a fiddle but I can't just now.
I created your table like this
create table `table` (ida int, idb int, `name` varchar(50));
insert into `table` (ida, idb, `name`) values
(1,2,'san'),
(2,2,'bang1'),
(3,3,'spam'),
(4,2,'23andme');
First comment - I would avoid using reserved words such as
table
or
name
The reason your attempt doesn't work is because it is the "wrong way around". Try this instead
SELECT * FROM `table` WHERE '00123andme' LIKE CONCAT('%',`name`,'%');
You can read up on pattern matching at
MySQL :: MySQL 8.0 Reference Manual :: 3.3.4.7 Pattern Matching[
^]
Kudos to @0X01AA for their comment about LOCATE
These queries also return the rows you mention
select * from `table` where LOCATE(`name`,'00123andme') > 0;
select * from `table` where LOCATE(`name`,'001bang1') > 0;