SQL Pattern Matching Deep Dive - Part 4, Empty matches and unmatched rows?
image courtesy of flicker: https://c1.staticflickr.com/1/55/185807556_21c547c02e_b.jpg I have been asked a number of times during and after presenting on this topic ( SQL Pattern Matching Deep Dive ) what is the difference between the various matching options such as EMPTY MATCHES and UNMATCHED ROWS . This is the area that I am going to cover in this particular blog post, which is No 4 in this deep dive series . When determining the type of output you want MATCH_RECOGNIZE to return most developers will opt for one of the following: ONE ROW PER MATCH - each match produces one summary row. This is the default. ALL ROWS PER MATCH - a match spanning multiple rows will produce one output row for each row in the match. The default behaviour for MATCH_RECOGNIZE is to return one summary row for each match. In the majority of use cases this is probably the ideal solution. However, there are also many use cases that require more detailed information to be returned. ...