重复查询以生成报告 [英] Repetition of query to produce report

查看:73
本文介绍了重复查询以生成报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建物料清单程序.

I am creating a bill of materials program.

有两个名为ProductsSub_Products的主表.

Products表中,字段为(Product_NameCode). 在Sub_Products表中,字段为(CodeSub_Name).

In the Products table, the fields are (Product_Name, Code). In the Sub_Products table, the fields are (Code, Sub_Name).

这些表与代码链接,即:一个product由许多sub_product组成,每个sub_product也是一个product,从而使其具有许多sub_product.

The tables are linked with code, i.e.: one product is made up of many sub_products, each sub_product is a product as well, making it have many sub_products.

我创建了一个读取product并获取其sub_product的查询.我需要查询以将Sub_NameProduct_Name进行比较,然后检查更多的sub_product, 继续直到找不到更多的sub_product.

I have created a query that reads a product and gets its sub_products. I need a query to compare Sub_Name with Product_Name and then check more sub_products, continuing until no more sub_products are found.

有什么想法吗?

推荐答案

我想您将不得不使用脚本而不是SQL查询来遍历它们.假设产品可以嵌套超过3个级别.

I guess you will have to use a script rather than SQL query to loop through them. Assuming that the products can be nested more than 3 levels.

这篇关于重复查询以生成报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆