Предполагая таблицу, подобную этой:
type, code, ... other columns.
Я предполагаю, что ваши первые 2 запроса похожи на
select type, count(*) from mytable group by type
select code, count(*) from mytable group by code
Тогда вы хотите сделать что-то вроде
SELECT DISTINCTROW mytable.Type, mytable.Code,
Count(*)/q1.[Count of type] AS [Percent Of Type],
Count(*)/q2.[Count of code] AS [Percent Of Code]
FROM mytable,
(select type, count(*) as [Count of type] from mytable group by type) q1,
(select code, count(*) as [Count of code] from mytable group by code) q2
where mytable.Type =q1.Type
and mytable.Code=q2.Code
GROUP BY mytable.Type, mytable.Code, q1.[Count of type], q2.[Count of code];
Надеюсь, это поможет.
Chris