Skip to content

Commit ddb0c9f

Browse files
Update applied-overview-of-MATCH_RECOGNIZE-clause.md
1 parent 547c9bb commit ddb0c9f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

applied-overview-of-MATCH_RECOGNIZE-clause.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Applied overview of MATCH_RECOGNIZE clause
22

3-
SQL MATCH_RECOGNIZE clause can perform Pattern Matching over a set of rows. MATCH_RECOGNIZE does this by assigning labels to events, finding the events within an ordered partition, and pulling out any sequences that match the given pattern
3+
SQL `MATCH_RECOGNIZE` clause can perform Pattern Matching over a set of rows. `MATCH_RECOGNIZE` does this by assigning labels to events, finding the events within an ordered partition, and pulling out any sequences that match the given pattern
44

55
To demonstrate the power of `MATCH_RECOGNIZE` we will use the Unemployment by State data set from BLS.
66

@@ -15,9 +15,9 @@ Analysis Approach
1515
We will use MATCH_RECOGNIZE to find the decreasing Unemployment Rate pattern PARTITIONed by State
1616
Enter MATCH_RECOGNIZE
1717

18-
The MATCH_RECOGNIZE clause is used to search for a pattern in single field value spanning over multiple records. This clause enables you to define patterns using regular expressions and aggregate methods to verify and extract values from the match.
18+
The `MATCH_RECOGNIZE` clause is used to search for a pattern in single field value spanning over multiple records. This clause enables you to define patterns using regular expressions and aggregate methods to verify and extract values from the match.
1919

20-
The following example shows the basic structure of a MATCH_RECOGNIZE clause:
20+
The following example shows the basic structure of a `MATCH_RECOGNIZE` clause:
2121

2222
```sql
2323
select state, months_of_decreasing_unemployment, streak_start_date, streak_end_date
@@ -59,11 +59,11 @@ MATCH_RECOGNIZE (
5959

6060
## PARTITION BY
6161

62-
PARTITION BY allows the match to be keyed and partitioned over a column name. A match will happen over every unique key specified by the partition statement. This enables a single query to be matched over all the keys and generate separate matches, one to every key.
62+
`PARTITION BY` allows the match to be keyed and partitioned over a column name. A match will happen over every unique key specified by the partition statement. This enables a single query to be matched over all the keys and generate separate matches, one to every key.
6363

6464
## MEASURES
6565

66-
MEASURES is used to define the projected values from the match using aggregate methods. For example, LAST(YEARMONTH) AS STREAK_END_DATE will output the last YEARMONTH value that was found over all events that matched pattern named DECREASE into field name STREAK_END_DATE.
66+
`MEASURES` is used to define the projected values from the match using aggregate methods. For example, LAST(YEARMONTH) AS STREAK_END_DATE will output the last YEARMONTH value that was found over all events that matched pattern named DECREASE into field name STREAK_END_DATE.
6767

6868
## PATTERN
6969

@@ -111,7 +111,7 @@ The following aggregate methods can be used in MEASURES and DEFINE:
111111

112112
## Query Output
113113

114-
The above MATCH_RECOGNIZE query will produce the following results, which show the States with a Streak decreasing Unemployment Rate.
114+
The above `MATCH_RECOGNIZE` query will produce the following results, which show the States with a Streak decreasing Unemployment Rate.
115115
Rhode Island has a decreasing Unemployment Rate start July 2021.
116116

117117
We see that Rhode Island has a decreasing Unemployment Rate starting July 2021.

0 commit comments

Comments
 (0)