Q:

Combine two query results horizontally

I have a table scott2 from which I run two queries from.
The first query is:
SELECT rateid, sysuserid, appraiserid, category, rate FROM `scott2` WHERE sysuserid = appraiserid and sysuserid = '20' group by category order by category;

which results to:

The second is:
SELECT rateid, sysuserid, appraiserid, category, sum(rate) FROM `scott2` WHERE sysuserid != appraiserid and sysuserid = '20' group by category order by category asc;

which results to:

I want to combine the results to below format. I want the sumrate column from query 2 adjacent to rate column from query 1.

SYSUSERID | CATEGORY | RATE | SUMRATE

I have tried with this subquery but to no avail.
SELECT sysuserid, category, 
(SELECT rate FROM `scott2` WHERE sysuserid = appraiserid and sysuserid = '20' group by category order by category asc) as 'rate',
(select sum(rate) from scott2 where sysuserid != appraiserid and sysuserid = '20' group by category order by category asc) as 'sumrate'
from scott2
group by category
order by category asc;

It errors: 

Subquery returns more than 1 row

How can I achieve what I want?

A:

In your main query you did not mantion "sysuserid = 20" in where and you are using "sysuserid = '20'"  that is not valid. Also when you are using group by category in main query you should mantion category in where condition od sub query.
To limit subquery secord with only one result, you can use limit. Although limit is not valid. You should validate unique result for combination of "sysuserid"+"category" logically. 
You can try below query. 
SELECT sysuserid, category, 
(SELECT sc_i.rate FROM `scott2` as sc_i WHERE sc_i.sysuserid = sc_i.appraiserid and sc_i.sysuserid = sc.sysuserid and sc_i.category = sc.category limit 1) as 'rate',
(SELECT sc_i.rate FROM `scott2` as sc_i WHERE sc_i.sysuserid <> sc_i.appraiserid and sc_i.sysuserid = sc.sysuserid and sc_i.category = sc.category limit 1) as 'sumrate'
from scott2 as sc
where sysuserid = 20
group by sysuserid, category
order by category asc;

