forked from yanglipeng/sqlfrog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlFuncSample.json
175 lines (175 loc) · 5.39 KB
/
sqlFuncSample.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
"sqlFun": {
"database": "sqlserver",
"functions": [
{
"funcName": "ASCII",
"arguments": [
{
"argument": {
"arguName": "character_expression",
"dataTypes": [
"char",
"varchar"
],
"description": "An expression of type char or varchar"
}
}
],
"returnType": "int",
"description": "Returns the ASCII code value of the leftmost character of a character expression",
"versions": [
"2008+",
"Azure SQL Database",
"Azure SQL Warehouse",
"Parallel Data Warehouse"
],
"category": "String",
"ansiCompatible": "",
"package": "",
"docLink": "",
"sample": "SELECT ASCII('A') AS A, ASCII('B') AS B, \nASCII('a') AS a, ASCII('b') AS b, \nASCII(1) AS [1], ASCII(2) AS [2];"
},
{
"funcName": "AVG",
"allDistinct": "optional",
"arguments": [
{
"argument": {
"arguName": "expression",
"dataTypes": [],
"description": "An expression of the exact numeric or approximate numeric data type category, except for the bit data type"
}
}
],
"clauses": [
{
"clause": {
"clauseName": "over",
"clauseContent": "[ partition_by_clause ] order_by_clause ) "
}
}
],
"returnType": "The evaluated result of expression determines the return type",
"description": "This function returns the average of the values in a group. It ignores null values",
"versions": [
"2008+",
"Azure SQL Database",
"Azure SQL Warehouse",
"Parallel Data Warehouse"
],
"category": "Aggregate",
"ansiCompatible": "",
"package": "",
"docLink": "https://docs.microsoft.com/en-us/sql/t-sql/functions/avg-transact-sql?view=sql-server-2017",
"sample": "SELECT AVG(DISTINCT ListPrice) FROM Production.Product;"
},
{
"funcName": "LAG",
"arguments": [
{
"argument": {
"arguName": "scalar_expression",
"dataTypes": [],
"description": "The value to be returned based on the specified offset"
}
},
{
"argument": {
"arguName": "offset",
"dataTypes": [
"integer",
"bigint"
],
"optional": true,
"description": "The number of rows back from the current row from which to obtain a value"
}
},
{
"argument": {
"arguName": "default",
"dataTypes": [],
"optional": true,
"description": "The value to return when scalar_expression at offset is NULL"
}
}
],
"clauses": [
{
"clause": {
"clauseName": "over",
"clauseContent": "[ partition_by_clause ] order_by_clause ) "
}
}
],
"returnType": "The data type of the specified scalar_expression",
"description": "Accesses data from a previous row in the same result set without the use of a self-join starting with SQL Server 2012 (11.x).",
"versions": [
"2012+",
"Azure SQL Database",
"Azure SQL Warehouse",
"Parallel Data Warehouse"
],
"category": "Analytic",
"ansiCompatible": "",
"package": "",
"docLink": "https://docs.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql?view=sql-server-2017",
"sample": "SELECT b, c,LAG(2*c, b*(SELECT MIN(b) FROM T), -c/2.0) OVER (ORDER BY a) AS i FROM T; "
},
{
"funcName": "OPENXML",
"arguments": [
{
"argument": {
"arguName": "idoc",
"dataTypes": [
"int"
],
"inoutMode": "in",
"description": ""
}
},
{
"argument": {
"arguName": "rowpattern",
"dataTypes": [
"nvarchar"
],
"inoutMode": "in",
"description": ""
}
},
{
"argument": {
"arguName": "flags",
"dataTypes": [
"byte"
],
"inoutMode": "in",
"description": ""
}
}
],
"clauses": [
{
"clause": {
"clauseName": "with",
"clauseContent": "SchemaDeclaration|TableName"
}
}
],
"returnType": "void",
"description": "OPENXML provides a rowset view over an XML document",
"versions": [
"2008+",
"Azure SQL Database"
],
"category": "Rowset",
"ansiCompatible": "",
"package": "",
"docLink": "https://docs.microsoft.com/en-us/sql/t-sql/functions/openxml-transact-sql?view=sql-server-2017",
"sample": "SELECT * \nFROM OPENXML (@idoc, '/ROOT/Customer',1) \n WITH (CustomerID varchar(10), \n ContactName varchar(20));"
}
]
}
}