Excel函数转换为SQL [英] Excel function converting to SQL
本文介绍了Excel函数转换为SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
=IF(ISERROR(MODE(D4:M4)),"",MODE(D4:M4))
我尝试了什么:
i不知道它的代码如何
What I have tried:
i do not know how do the code for it
推荐答案
可以使用聚合
SELECT TOP 1 Column_Name
FROM Table_name
GROUP BY [Column_Name]
ORDER BY COUNT(*) DESC
现在看来,您要在Excel工作表中执行此操作的值是行而不是列。您需要首先对该行执行 UNPIVOT
查询,然后对此进行上述查询。
使用PIVOT和UNPIVOT - SQL Server Microsoft Docs [ ^ ]
Now it appears that the values that you want to do this on in your Excel worksheet are in rows and not columns. You would need to do an UNPIVOT
query on the row first and then do the above query on that.
Using PIVOT and UNPIVOT - SQL Server | Microsoft Docs[^]
这篇关于Excel函数转换为SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文