reporting-services - 过滤多数数
解决方案
我试图从 sql 的角度来满足您的要求。我们如何限制来自数据库的数据,因为只有那些记录,例如joe user 2数据才应该出现。而不是在 ssrs 方面工作,即在加载完整数据之后将是一个痛苦的过程。我为 sql 创建了一个小提琴。您能否看一下它,以便您了解如何限制数据。
这是小提琴链接:http ://sqlfiddle.com/#!9/8f78c5/2
下面的代码:架构
-- borrowed from https://stackoverflow.com/q/7745609/808921
CREATE TABLE IF NOT EXISTS `docs` (
`id` int(6) unsigned NOT NULL,
`rev` int(3) unsigned NOT NULL,
`content` varchar(200) NOT NULL,
PRIMARY KEY (`id`,`rev`)
) DEFAULT CHARSET=utf8;
INSERT INTO `docs` (`id`, `rev`, `content`) VALUES
('1', '1', 'The earth is flat'),
('2', '1', 'One hundred angels can dance on the head of a pin'),
('1', '2', 'The earth is flat and rests on a bull\'s horn'),
('1', '3', 'The earth is like a ball.'),
('2', '2', 'One hundred angels can dance on the head of a pin');
下面的 SQL 查询
select * from `docs` where id=(select id from `docs` group by id order by count(id) desc LIMIT 1)
推荐阅读
- objective-c - 在混合的 objc/swift 模块中,Xcode 总是尝试包含模块本身
- javascript - 如何将纬度和对数从数据库传递到节点js中的ejs文件
- cakephp - CakePHP 3.x 或在具有多个相同字段的查找条件中
- here-api - 美国使用此处的地图计算通行费成本
- angular - 我希望子路由是动态的,就像我点击类别并在组件中生成 url
- sql - 如何在 BigQuery 中使用带有日期的 SQL
- linux - 从bash(循环)中的文件内容设置变量
- android - 检测安装在真实设备中的 Android 应用程序?
- rest - Keycloak 管理员用户创建
- node.js - 如何仅捕获用户修改的字段