【发布时间】:2013-10-06 10:58:42
【问题描述】:
我有两张桌子:
1. Products with the following columns:
* ID
* SerialNumber
* Name
2. ProductsData
* ID
* ProductID
* DateOfData
* DataValue
我想查看以下内容:
* Product name.
* product serial number
* the last date of data for this product.
* the data value in this datetime
如何通过 SQL 查询来制作视图?
谢谢
【问题讨论】:
-
我尝试了使用 innerjoin 的方法,但它返回了第二个表中的所有行。我只想要最后的数据
-
@user1902346 下一次,将您的尝试与您的问题一起发布,这样人们就会知道您在提问之前为此付出了一些努力。这通常会导致更多的答案和更少的反对票。
标签: sql sql-server database view