大家好,我在python上遇到了这个问题,我已经尝试解决了这个问题,请在这里将问题发布在我们的主题中。
select a.*,
( select value from b where b.a_id = a.id and b.key = 'looks' ) as looks,
( select value from b where b.a_id = a.id and b.key = 'lazy' ) as lazy,
( select value from b where b.a_id = a.id and b.key = 'car' ) as car,
( select value from b where b.a_id = a.id and b.key = 'email' ) as email
from a
where a.id = 1;
答案 0 :(得分:2)