如何在几个表中以及每个表之间进行测试? [英] How to test in and between each of several tables?

查看:45
本文介绍了如何在几个表中以及每个表之间进行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这对于大多数人来说太简单了,但是我只是无法从正在使用的三本书中找到答案,也无法在教程中找到它.他们全都专注于更改数据库的布局,并且仅给出有关此类事情的注释.

I know this is too simple for most here, but I just can't figure it out from the 3 books I am using or find it in a tutorial. They all focus on changing the layout of a database and only give notes about these sort of things.

我能够创建一个能够在9分钟内激活的过程,其他需要正常运行的过程.

I was able to create a procedure that activates ever 9 minutes, and the other things it needs to do work fine.

但是我只是找不到如何做这部分.

But I just can't find how to do this part.

Table_A

(ID, UnitTypeID, ShopLot, )

Table_B

(ID, UnitTypeID, ShopLot, ContainerRef, )

Table_C

(ID, PartTypeID, ContainerID, )

  1. 我首先需要选择Table_A中的所有UnitTypeID=PAD
  2. 然后在Table_B中查找与#1的结果共享ShopLot的所有UnitTypeID=FROG实例
  3. 然后对于每个ContainerRef配件#2,检查Table_C中的PartTypeID=FLIES,其中ContainerRefContainerID匹配
  1. I need to begin by selecting all UnitTypeID=PAD in Table_A
  2. Then find all instances of UnitTypeID=FROG in Table_B that share ShopLot with the results from #1
  3. Then for each ContainerRef fitting #2, check Table_C for PartTypeID=FLIES where the ContainerRef matches the ContainerID

这当然与青蛙和苍蝇无关,但是它很好地表明了该过程的工作原理.

It isn't to do with frogs and flies of course, but it makes for a good relative indication of how the process works.

找到有效的"FLIES"后,我将在此部分下面应用代码,然后完成.

Once I find a valid 'FLIES' I apply the code below this part and it is done.

如果没有发现,什么也没有发生..我猜青蛙还要饿9分钟.

If none are found, nothing happens.. and I guess the frog is hungry for 9 more minutes.

(我希望获得有关良好查询语言参考的建议.MySQL站点/视频/内容似乎都几乎完全集中在数据类型和数据库布局/结构化事物上.很少涉及处理实际数据)

(I am open to suggestions for a good query language reference. MySQL sites/videos/tuts all seem to focus almost entirely on data types and database layouts / structural things. Very little about dealing with the actual data)

推荐答案

АлександрМиладинович设法简化了一些我已经放弃但过于先进而无法考虑的东西.

Александр Миладинович managed to simplify to the point of "easy" something I had given up on as too advanced to consider.

我唯一需要确定的就是如何说服MySQL像SQL Server一样对每一行进行操作,并且我可以以合理的步调回到学习上.

The only thing left for me to determine is how to convince MySQL to do For Each Row as with SQL-Server, and I can move back to learning at a reasonable pace.

这篇关于如何在几个表中以及每个表之间进行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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