Writing Simple Streaming SQL Queries

<< Click to Display Table of Contents >>

Navigation:  Analyzing Data in s-Server >

Writing Simple Streaming SQL Queries

Previous pageReturn to chapter overviewNext page

Filtering Streams - SQL WHERE

You can perform basic filtering on a stream using the SQL WHERE clause. Given a stream with web login event data, the following query selects only those for which the login was unsuccessful:

SELECT STREAM *

 FROM "WebAppLoginEvents"

WHERE "loginSuccessful" = FALSE;

 

Merging Streams - SQL UNION ALL

Streams can be combined using the SQL UNION ALL operator. The resulting output stream simply consists of all rows from both the input streams. For example, the following query (taken from The Edamame Demo produces a stream of orders taken over the phone or via the web:

SELECT STREAM *

 FROM PhoneOrders

UNION ALL

SELECT STREAM *

 FROM WebOrders