Help combining two MySQL queries to improve performance
I'm assuming that G followed by anything is valid in the second case. If so you sould be able to replace your 3 queries with something like:

SELECT d.field_id_105 AS code
     , t.title AS title,
     , t.entry_date AS entry_date
     , t.entry_id AS entry_id
     , i.title AS installer
     , i.entry_id AS installer_id
     , d.entry_id
FROM exp_channel_data AS d
JOIN exp_relationships AS r 
    ON r.parent_id = d.entry_id 
   AND r.field_id = 48
JOIN exp_channel_titles AS t 
    ON d.entry_id = t.entry_id 
   AND t.status = 'open'
JOIN exp_channel_titles AS i 
    ON r.child_id = i.entry_id 
   AND i.status = 'open'
WHERE SUBSTR(d.field_id_56,1
            ,CASE WHEN SUBSTR(d.field_id_56,1,2) REGEXP '[A-Z][0-9]'
                                    THEN 1 
                                    ELSE 2
                               END)
    = SUBSTR(d.field_id_105,1
            ,CASE WHEN SUBSTR(d.field_id_56,1,2) REGEXP '[A-Z][0-9]' 
                                    THEN 1 
                                    ELSE 2
                               END)
AND d.channel_id = 12;


This is untested and may contain syntax errors since there where no ddl in the question.