This will do the trick:
select a.id from myActions a, (select ASCII(act) n, id from myActions) c
where char(c.n+1)=substring(a.act,2,1) and char(c.n+2)=substring(a.act,3,1)
and a.id=c.id;
The table in example is:
create table myActions(
id int(11) not null auto_increment,
act char(3),
primary key(id))
insert into myActions (act) values
('ABC'),('DHI'),('EFG'),('LMN'),('XYV'),('XYZ'),('CBA'),('HIJ')
another option is a procedure.
table looks like this:
1 ABC
2 DHI
3 EFG
4 LMN
5 XYV
6 XYZ
7 CBA
8 HIJ
and result is: 1,3,4,6,8
UPDATE:
at the end of the query add : and productId='A001' to get:
select a.id from myActions a, (select ASCII(act) n, id from myActions) c
where char(c.n+1)=substring(a.act,2,1) and char(c.n+2)=substring(a.act,3,1)
and a.id=c.id and productId='A001';
You will need to specify the productId you seek as there may be two different productIds with matching sets.