Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 67ca96e

Browse files
authored
Use of DISTINCT is not allowed with the OVER clause.
Example query that doesnt work (docs says it works) ``` SELECT *, count(DISTINCT OrderQty) OVER (PARTITION BY SalesOrderID) AS "Min" FROM Sales.SalesOrderDetail WHERE SalesOrderID IN(43659,43664); GO ```
1 parent 25d2265 commit 67ca96e

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

docs/t-sql/functions/count-transact-sql.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,7 @@ This function returns the number of items found in a group. `COUNT` operates lik
3838
## Syntax
3939

4040
```sql
41-
-- Syntax for SQL Server and Azure SQL Database
42-
43-
COUNT ( { [ [ ALL | DISTINCT ] expression ] | * } )
44-
[ OVER (
45-
[ partition_by_clause ]
46-
[ order_by_clause ]
47-
[ ROW_or_RANGE_clause ]
48-
) ]
49-
```
50-
51-
```sql
52-
-- Syntax for Azure SQL Data Warehouse and Parallel Data Warehouse
41+
-- Syntax
5342

5443
-- Aggregation Function Syntax
5544
COUNT ( { [ [ ALL | DISTINCT ] expression ] | * } )

0 commit comments

Comments
 (0)