I have the following table with information:
What I need to show is this:
I try with this code, but I duplicate the data:
SELECT * FROM
(SELECT Codigo AS LYC
FROM RequerimientoDetalle
WHERE Codigo like '%LYC%') t1,
(SELECT Codigo AS MYE
FROM RequerimientoDetalle
WHERE Codigo like '%MYE%') t2
My question is if there is any function for mysql or sqlserver engine, to be able to successfully perform this query.
Also try to group them and the result is the same.
Take into account that the table grows, MyE-3..5,6,7.etc or LyC-3..5,6,7.etc