从具有exlus的表中选择值 [英] Selecting Values from a table with exlusions

查看:66
本文介绍了从具有exlus的表中选择值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我目前正在尝试创建一个用户可以查看数据的视图,



a收货表和发货表



i只想显示发货日期> 1的展示记录。比接收日期。

Hi

I am currently trying to create a view where a user will be able to look at data,

a Receiving table and a dispatch table

i want to show only show records where the dispatch date is > than the receiving date.

推荐答案

提示:*

考虑两张桌子的LEFT JOIN。

可以使用日期比较来从联接中剔除不需要的记录。



建议使用LEFT JOIN,因为不清楚所有记录是否始终都在表。当然,连接的左侧是可能/可能不匹配的表(即主表)。如果他们总是1:1,那么你可以使用内部联接。



*如果没有这两个表的架构,我所能做的就是给你向正确的方向推进。







HINTS:*
Consider a LEFT JOIN of the two tables.
A date comparison can be used to cull the undesired records from the join.

A LEFT JOIN is suggested because it''s not clear if all records are always in both tables. The left side of the join would, of course, be the table to which there may/may not be a match (i.e., the primary table). If they''re always 1:1, then you can use an inner join.

* Without the schema for the two tables, all I can do is give you a push in the right direction.



.


这篇关于从具有exlus的表中选择值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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