You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/tables/manage-retention-of-historical-data-in-system-versioned-temporal-tables.md
+18-16Lines changed: 18 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,25 +130,27 @@ To maintain a sliding window, you need to make predicate function to be accurate
The following example creates a view named CustomerView and then uses a HASH JOIN query hint in a query that references a view and a table.
133
130
134
131
```sql
135
-
-- Uses AdventureWorks
132
+
-- Uses the AdventureWorks sample database
136
133
137
134
CREATEVIEWCustomerView
138
135
AS
139
136
SELECT CustomerKey, FirstName, LastName FROM ssawPDW..DimCustomer;
140
-
137
+
GO
141
138
SELECTCOUNT (*) FROMdbo.CustomerView a
142
139
INNER JOINdbo.FactInternetSales b
143
140
ON (a.CustomerKey=b.CustomerKey)
144
141
OPTION (HASH JOIN);
145
-
142
+
GO
146
143
DROPVIEW CustomerView;
144
+
GO
147
145
```
148
146
149
147
### F. Query with a subselect and a query hint
150
148
The following example shows a query that contains both a subselect and a query hint. The query hint is applied globally. Query hints are not allowed to be appended to the subselect statement.
151
149
152
150
```sql
153
-
-- Uses AdventureWorks
154
-
151
+
-- Uses the AdventureWorks sample database
155
152
CREATEVIEWCustomerViewAS
156
153
SELECT CustomerKey, FirstName, LastName FROM ssawPDW..DimCustomer;
Copy file name to clipboardExpand all lines: docs/t-sql/statements/create-materialized-view-as-select-transact-sql.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,7 @@ A user needs following permissions to create a materialized view in addition to
161
161
## Example
162
162
A. This example shows how Synapse SQL optimizer automatically uses materialized views to execute a query for better performance even when the query uses functions un-supported in CREATE MATERIALIZED VIEW, such as COUNT(DISTINCT expression). A query used to take multiple seconds to complete now finishes in sub-second without any change in the user query.
163
163
164
-
```sql
164
+
```sql
165
165
166
166
-- Create a table with ~536 million rows
167
167
createtablet(a intnot null, b intnot null, c intnot null) with (distribution=hash(a), clustered columnstore index);
0 commit comments