0
点赞
收藏
分享

微信扫一扫

构建LangChain应用程序的示例代码:62、如何使用Oracle AI向量搜索和Langchain构建端到端的RAG(检索增强生成)pipeline

残北 2024-07-24 阅读 25

1、left join 结果集行数与主表查询结果集行数一致
2、主表与辅表多关联条件要括起来
3、对于辅表的过滤条件写在on后面是先对辅表过滤后再与主表关联,写在where后面是对主表与辅表关联后的结果集再进行过滤
4、对于主表的过滤条件写在on后面不生效,只能写在where后面

例如:

select t.t1,
	listagg(d.d2,',')  as d2s 
	from table1 t
	left join table2 d
	on (t.t1 = d.d1 and t.t2 = d.d2 and d.status in ('0','1'))
	where t.status='3'
	and t.roleid in ('roleA','roleB')
	and t.orgcode in ('3500')
group by t.t1

d.status in ('0','1')过滤条件写on后面是先对表d过滤缩小范围后再与主表关联,若写在where后面则是对主表与辅表关联后结果集再进行过滤。
举报

相关推荐

0 条评论