56,678
社区成员
发帖
与我相关
我的任务
分享
table_a:
//字段[id,key]
1 a_1
2 a_2
3 a_3
table_b:
//字段[id,关联a表id,值的类型,值]
1 1 type_1 value_1
2 1 type_2 value_2
3 2 type_1 value_3
//如果我这样写语句
select a.text,b.value from table_a a
left jion table_b b
on a.id = b.table_a_id
where b.type = 'type_1'
//出来是这样的结果
a_1 value_1
a_1 value_3
//但是我想要这样的结果
a_1 value_1
a_1 value_3
a_2 null
a_3 null