0

Given a table that has 3 columns: C1, C2, C3

C1 - C2 - C3
M  - is - M1
N2 - is - N3
M2 - is - M3
M3 - is - M4
N1 - is - N2
M1 - is - M2
N  - is - N1

How to convert this Simple SQLServer statement into MySQL statement:

declare @searchString varchar(32) = 'M';
with cte(results) as
(
    select C3 from Tbl where C1 = @searchString
    union all
    select t.C3 from Tbl t inner join cte c on c.C3 = t.C1 
) select * from cte;
Tom
  • 825
  • 1
  • 8
  • 28

0 Answers0