plsql多表联合查询
时间: 2023-09-27 14:09:28 浏览: 102
您使用PL/SQL开发工具来进行多表联合查询。根据引用和引用的信息,您可以使用以下SQL语句来进行plsql多表联合查询:
SELECT pl.doc_type_name as "name", pl.project_uuid as "id", count(doc_type_name) as "acount"
FROM pb_attachment pb, pl_project_document pl
WHERE pb.DATA_UUID = pl.PROJECT_DOCUMENT_UUID
AND pl.del_tag = '0'
GROUP BY pl.doc_type_name, pl.project_uuid
这个查询将从pb_attachment和pl_project_document两个表中查询出符合条件的数据,并按照文档类型和项目ID进行分组。然后,将文档类型名称、项目ID和文档数量作为结果返回。
另外,您还可以使用以下SQL语句来进行取证单和工作底稿的联合查询:
SELECT proof.project_uuid as "id", proof.proof, manuscript.manuscript
FROM
(
SELECT count(project_uuid) as "proof", project_uuid
FROM PROOF
WHERE del_tag = '0'
GROUP BY project_uuid
) proof,
(
SELECT count(project_uuid) as "manuscript", project_uuid
FROM MANUSCRIPT
WHERE del_tag = '0'
GROUP BY project_uuid
) manuscript
WHERE proof.project_uuid = manuscript.project_uuid
这个查询会将取证单和工作底稿满足条件的数据联合查询,并返回所属项目ID、取证单数量和工作底稿数量。
综上所述,通过使用上述SQL语句,您可以实现plsql的多表联合查询。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [oracle/plsql developer 联合安装软件](https://download.csdn.net/download/zzjstudent/10696929)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [PLSQL数据库六表查询案例](https://blog.csdn.net/qq_45645324/article/details/127977901)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文