[h2] Select data from range between conversational openings and closings (chat log analysis using SQL / H2 Database)

2017-09-19 Thread Adam McMahon
My first instinct would be do do this at the application level. Not with a 
single query. It will be easy to do this in the application. So long as your 
data is not too big. 


-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Select data from range between conversational openings and closings (chat log analysis using SQL / H2 Database)

2017-09-13 Thread 'Henning Mayer' via H2 Database



I have a table named "conversations" and it holds data like this:



 TIMESTAMP   | ACTOR| CONTEXT| MESSAGE| CLASSIFICATION
-+--+++---
01.02.2015 09:38 | user | text   | blablabla  | normal
01.02.2015 09:46 | bot  | text   | blablabla  | normal
01.02.2015 10:19 | user | text   | hi bot!| opening
01.02.2015 10:20 | bot  | text   | blablabla  | normal
01.02.2015 10:21 | user | text   | blablabla  | normal
01.02.2015 10:22 | bot  | text   | blablabla  | normal
01.02.2015 10:23 | user | text   | ok bye bot | closing
01.02.2015 11:53 | bot  | text   | blablabla  | normal
01.02.2015 12:14 | user | text   | goodbye| closing
01.02.2015 12:33 | bot  | text   | blablabla  | normal
01.02.2015 12:51 | bot  | text   | blablabla  | normal



What I want to SELECT is the range between 'openings' and 'closings' in my 
dataset in order to separate successfully framed conversations from all 
other user inputs / bot outputs.

The expected output would be:

 TIMESTAMP   | ACTOR| CONTEXT| MESSAGE| CLASSIFICATION
-+--+++---
01.02.2015 10:19 | user | text   | hi bot!| opening
01.02.2015 10:20 | bot  | text   | blablabla  | normal
01.02.2015 10:21 | user | text   | blablabla  | normal
01.02.2015 10:22 | bot  | text   | blablabla  | normal
01.02.2015 10:23 | user | text   | ok bye bot | closing


Do you have any suggestions of how to query my dataset in order to receive 
the output above?

Thanks and best wishes.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.