从另一个表中选择一个表中的数据. [英] Select Data from one table on the basis of another table.

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

问题描述

大家好,

我需要从另一个表中选择一个数据.

第一个表具有必填字段和reportid.

此reportid(与第一个表相同)以及用户名和当前日期字段位于第二个表中.

现在,首先我需要检查第二个表中的数据是否与当日的该reportid相对照,然后如果存在,请从第一个表中选择数据.

我真的很困惑.

请帮助我!

在此先感谢.

Hi All,

I need to select data from one table on the basis of other table.

The first table has the required fields and reportid.

This reportid(same as first table), and username, current date fields are present in second table.

Now first i need to check if data is present in second table against that reportid in today''s date and then if it is present, select data from first table.

I am really confused.

Please help me in this!

Thanks in Advance.

推荐答案

尝试一下.
Try this.
SELECT FT.* FROM firsttable FT INNER JOIN secondtable ST ON FT.reportid = ST.reportid AND date = 'date here'


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

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