SELECT DISTINCT行 - USQL [英] SELECT DISTINCT row - USQL
问题描述
大家好,
有没有办法像在SQL中那样在USQL中执行SELECT DISTINCT(column_name)?
Is there a way to do a SELECT DISTINCT(column_name) in USQL like you would do in SQL?
示例:
@input EXTRACT column1 string,column2 string ....
@input EXTRACT column1 string, column2 string ....
@noDupInput SELECT column1,column2 ....(让我们看看说我想对第1列值或仅在整行上做一个明确的分析)
@noDupInput SELECT column1, column2 .... (Let's say I want to do a distinct on column 1 value or just the entire row)
我只是想过滤掉重复项,我知道USQL使用C#语言很多但是不能找到很多关于USQL的特色。
I pretty much just want to filter out duplicates and I know USQL uses C# language a lot but couldn't find much about distinct feature for USQL specific.
谢谢
Choiboy
推荐答案
Hello Choiboy96。 感谢您的提问。
Hello Choiboy96. Thank you for your question.
U-SQL中有一个DISTINCT关键字。 以下是相应文档的链接。
There is a DISTINCT keyword in U-SQL. Here are links to the appropriate documentation.
https://docs.microsoft.com/en-us/u-sql/statements-and-expressions/select/select-clause
https://docs.microsoft.com/en-us/u-sql/statements-and-expressions/select/select-clause#dist
https://docs.microsoft.com/en-us/u-sql/statements-and-expressions/select/select-clause
https://docs.microsoft.com/en-us/u-sql/statements-and-expressions/select/select-clause#dist
在你的示例如下:
@noDupInput = SELECT DISTINCT column1,column2 .... FROM @input;
In your example it would be:
@noDupInput = SELECT DISTINCT column1, column2 .... FROM @input;
这是否帮助你吗?
这篇关于SELECT DISTINCT行 - USQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!