View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,801–5,825 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6119 | 2018-06-30 | 2018-06-30 11:09:44 | 1 | Walk |
| 6120 | 2018-10-25 | 2018-10-25 09:58:37 | 4 | Bus |
| 6121 | 2018-10-25 | 2018-10-25 09:58:51 | 4 | Bus |
| 6122 | 2018-10-25 | 2018-10-25 09:58:51 | 4 | Bus |
| 6123 | 2018-10-25 | 2018-10-25 09:59:01 | 4 | Bus |
| 6124 | 2018-10-25 | 2018-10-25 09:59:13 | 4 | Bus |
| 6125 | 2018-10-25 | 2018-10-25 09:59:47 | 4 | Bus |
| 6126 | 2018-10-25 | 2018-10-25 09:59:55 | 4 | Bus |
| 6127 | 2018-10-25 | 2018-10-25 09:59:05 | 4 | Bus |
| 6128 | 2018-10-25 | 2018-10-25 09:59:49 | 4 | Bus |
| 6129 | 2018-10-25 | 2018-10-25 10:00:07 | 4 | Bus |
| 6130 | 2018-10-25 | 2018-10-25 10:00:17 | 4 | Bus |
| 6131 | 2018-10-25 | 2018-10-25 10:00:16 | 4 | Bus |
| 6132 | 2018-10-25 | 2018-10-25 10:01:13 | 4 | Bus |
| 6133 | 2018-10-25 | 2018-10-25 10:00:47 | 4 | Bus |
| 6134 | 2018-10-25 | 2018-10-25 10:01:25 | 4 | Bus |
| 6135 | 2018-10-25 | 2018-10-25 10:02:22 | 4 | Bus |
| 6136 | 2018-10-25 | 2018-10-25 09:59:57 | 4 | Bus |
| 6137 | 2018-10-25 | 2018-10-25 10:02:01 | 4 | Bus |
| 6138 | 2018-10-25 | 2018-10-25 10:02:13 | 4 | Bus |
| 6139 | 2018-10-25 | 2018-10-25 10:02:06 | 4 | Bus |
| 6140 | 2018-10-25 | 2018-10-25 10:00:17 | 4 | Bus |
| 6141 | 2018-10-25 | 2018-10-25 10:03:52 | 4 | Bus |
| 6142 | 2018-10-25 | 2018-10-25 10:02:39 | 4 | Bus |
| 6143 | 2018-10-25 | 2018-10-25 10:00:32 | 4 | 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;