View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,301–6,325 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6627 | 2018-12-24 | 2018-12-24 10:23:18 | 1 | Bus |
| 6628 | 2018-12-24 | 2018-12-24 10:23:32 | 1 | Bus |
| 6629 | 2018-12-24 | 2018-12-24 10:23:52 | 1 | Bus |
| 6630 | 2018-12-24 | 2018-12-24 10:23:31 | 1 | Bus |
| 6631 | 2018-12-24 | 2018-12-24 10:24:14 | 1 | Bus |
| 6632 | 2018-12-24 | 2018-12-24 10:24:13 | 1 | Bus |
| 6633 | 2018-12-24 | 2018-12-24 10:23:36 | 1 | Bus |
| 6634 | 2018-12-24 | 2018-12-24 10:24:17 | 1 | Bus |
| 6635 | 2018-12-24 | 2018-12-24 10:23:36 | 1 | Bus |
| 6636 | 2018-12-24 | 2018-12-24 10:24:02 | 1 | Bus |
| 6637 | 2018-12-24 | 2018-12-24 10:24:08 | 1 | Bus |
| 6638 | 2018-12-24 | 2018-12-24 10:25:58 | 1 | Bus |
| 6639 | 2018-12-24 | 2018-12-24 10:25:16 | 1 | Bus |
| 6640 | 2018-12-24 | 2018-12-24 10:26:26 | 1 | Bus |
| 6641 | 2018-12-24 | 2018-12-24 10:24:48 | 1 | Bus |
| 6642 | 2018-12-24 | 2018-12-24 10:26:20 | 1 | Bus |
| 6643 | 2018-12-24 | 2018-12-24 10:25:38 | 1 | Bus |
| 6644 | 2018-12-24 | 2018-12-24 10:25:09 | 1 | Bus |
| 6645 | 2018-12-24 | 2018-12-24 10:25:56 | 1 | Bus |
| 6646 | 2018-12-24 | 2018-12-24 10:27:29 | 1 | Bus |
| 6647 | 2018-12-24 | 2018-12-24 10:24:46 | 1 | Bus |
| 6648 | 2018-12-24 | 2018-12-24 10:26:23 | 1 | Bus |
| 6649 | 2018-12-24 | 2018-12-24 10:28:56 | 1 | Bus |
| 6650 | 2018-12-24 | 2018-12-24 10:29:11 | 1 | Bus |
| 6651 | 2018-12-24 | 2018-12-24 10:26:50 | 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;