SQL Server Reporting Service - 引用另一个数据集? [英] SQL Server Reporting Service - Reference another dataset?

查看:52
本文介绍了SQL Server Reporting Service - 引用另一个数据集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQL Server 2008 Reporting Services 报告中有两个数据集.我需要将 WHERE 子句附加到将包含第一个值的第二个子句.我应该如何编写第二个查询?

I have two datasets in a SQL Server 2008 reporting services report. I need to attach a WHERE clause to the second one that will contain a value from the first one. How should I write that second query?

推荐答案

如果我明白你在问什么,你应该在 where 子句中运行一个 SUB 查询.

If I understand what you are asking, you should run a SUB query within the where clause.

从书籍中选择书名WHERE author_id IN (SELECT id FROM author);

SELECT title FROM books WHERE author_id IN (SELECT id FROM authors);

这篇关于SQL Server Reporting Service - 引用另一个数据集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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