これを解決するのを手伝ってください。2番目の列に1番目の列と同じ方法で結果がある場合、null値を取得しています。
select
(case when parents = '3' then child end) 3_rec,
(case when parents = '10' then child end) 10_rec
from
(
SELECT concat(a.name,' (',b.count,')') as child,b.parent as parents FROM wp_terms a,wp_term_taxonomy b where
a.term_id=b.term_id and b.parent = 3 and b.taxonomy = 'category'
union all
SELECT concat(a.name,' (',b.count,')') as child,b.parent as parents FROM wp_terms a,wp_term_taxonomy b where
a.term_id=b.term_id and b.parent = 10 and b.taxonomy = 'category'
) d order by 1,2 asc
私が期待している結果.Nullは最後に来るはずです.
3_rec|10_rec
------------
row1 | row1
row2 | row2
row3 | row3
| row4
| row5