oracle合并SQL为一条数据
问题描述:
咋样用一条SQL吧这两条数据合成一条数据,a表的数据都一样,区别在于b表。a表和b表的公共字段a.accountid=b.accountid是这个,现在我想要一条数据,取别名也可以,下面这个是查询语句。
select a.accountid ,a.reportmatters , b.resultid,b.checkdeptid,b.checkdeptid ,b.checkorgid ,b.checkor ,b.checktime ,b.checkresult ,b.checkdesc ,b.checklevel
from t21_pma_account_info a,t21_pma_checkresult b
where a.accountid=b.accountid
and a.accountid='65B96092FFFFFFFC0159DFB574FDF7E8'
答
你这相当于自然连接了,根据你以哪个表为基准,选择左连接或者右连接
答
可以使用左连接或者右连接
答
你这个问题描述的不是很清楚啊
答
left join 左连接