View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,426–7,450 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7822 | 2019-04-11 | 2019-04-11 13:18:48 | 1 | Train |
| 7823 | 2019-04-11 | 2019-04-11 13:18:47 | 1 | Train |
| 7824 | 2019-04-11 | 2019-04-11 13:18:12 | 1 | Train |
| 7825 | 2019-04-15 | 2019-04-15 12:01:34 | 1 | Bus |
| 7826 | 2019-04-15 | 2019-04-15 12:01:48 | 1 | Bus |
| 7827 | 2019-04-15 | 2019-04-15 12:01:58 | 1 | Bus |
| 7828 | 2019-04-15 | 2019-04-15 12:01:52 | 1 | Bus |
| 7829 | 2019-04-15 | 2019-04-15 12:02:06 | 1 | Bus |
| 7830 | 2019-04-15 | 2019-04-15 12:02:19 | 1 | Bus |
| 7831 | 2019-04-15 | 2019-04-15 12:02:52 | 1 | Bus |
| 7832 | 2019-04-15 | 2019-04-15 12:02:09 | 1 | Bus |
| 7834 | 2019-04-15 | 2019-04-15 12:02:38 | 1 | Bus |
| 7835 | 2019-04-15 | 2019-04-15 12:03:31 | 1 | Bus |
| 7836 | 2019-04-15 | 2019-04-15 12:03:34 | 1 | Bus |
| 7837 | 2019-04-15 | 2019-04-15 12:04:08 | 1 | Bus |
| 7839 | 2019-04-15 | 2019-04-15 12:03:10 | 1 | Bus |
| 7840 | 2019-04-15 | 2019-04-15 12:04:36 | 1 | Bus |
| 7841 | 2019-04-15 | 2019-04-15 12:02:44 | 1 | Bus |
| 7842 | 2019-04-15 | 2019-04-15 12:03:19 | 1 | Bus |
| 7843 | 2019-04-15 | 2019-04-15 12:03:26 | 1 | Bus |
| 7844 | 2019-04-15 | 2019-04-15 12:04:07 | 1 | Bus |
| 7845 | 2019-04-15 | 2019-04-15 12:05:46 | 1 | Bus |
| 7846 | 2019-04-15 | 2019-04-15 12:05:22 | 1 | Bus |
| 7847 | 2019-04-15 | 2019-04-15 12:05:54 | 1 | Bus |
| 7848 | 2019-04-15 | 2019-04-15 12:05:46 | 1 | Bus |
View definition
CREATE VIEW museum_visit AS
SELECT
e.ticket_id,
date(e.scanned_at) AS visit_date,
e.scanned_at AS first_entry_at,
e.entrance_id,
e.transport_mode
FROM entry_scan e
WHERE e.is_first_entry = 1;