小编Omr*_*mri的帖子

在窗口函数中使用 DISTINCT 和 OVER

我正在尝试将查询从 Oracle 迁移到 SQL Server 2014。

这是我在 Oracle 中运行良好的查询:

select
count(distinct A) over (partition by B) / count(*) over() as A_B
from MyTable 
Run Code Online (Sandbox Code Playgroud)

这是我尝试在 SQL Server 2014 中运行此查询后遇到的错误。

Use of DISTINCT is not allowed with the OVER clause
Run Code Online (Sandbox Code Playgroud)

有谁知道是什么问题?在 SQL Server 中可以进行这种查询吗?请指教。

sql-server window-functions sql-server-2014

19
推荐指数
4
解决办法
5万
查看次数

模式从 mysql 4 迁移到 mysql 5.6 后的问题

最近,我将一些模式从mysql 4实例迁移到了mysql 5.6bymysqldump和 import 操作的实例。经过一些语法调整,我可以成功导入转储文件。

导入后,我查看了日志文件,发现了一些问题。有谁知道那是什么以及如何解决它?

InnoDB: Error in pars0opt.cc: table cars/cars_ftr_a has prefix_len != 0
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_BEING_DELETED'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_BEING_DELETED_CACHE'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_CONFIG'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_DELETED'
InnoDB: in InnoDB …
Run Code Online (Sandbox Code Playgroud)

mysql mysqldump migration mysql-5.6

6
推荐指数
1
解决办法
272
查看次数