View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,026–7,050 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7387 | 2019-01-12 | 2019-01-12 10:54:48 | 4 | Metro |
| 7388 | 2019-02-11 | 2019-02-11 16:42:11 | 1 | Metro |
| 7389 | 2019-02-19 | 2019-02-19 09:34:25 | 1 | Bus |
| 7390 | 2019-02-19 | 2019-02-19 09:34:37 | 1 | Bus |
| 7391 | 2019-02-19 | 2019-02-19 09:34:43 | 1 | Bus |
| 7392 | 2019-02-19 | 2019-02-19 09:34:49 | 1 | Bus |
| 7393 | 2019-02-19 | 2019-02-19 09:34:57 | 1 | Bus |
| 7394 | 2019-02-19 | 2019-02-19 09:35:30 | 1 | Bus |
| 7395 | 2019-02-19 | 2019-02-19 09:35:13 | 1 | Bus |
| 7396 | 2019-02-19 | 2019-02-19 09:35:35 | 1 | Bus |
| 7397 | 2019-02-19 | 2019-02-19 09:35:37 | 1 | Bus |
| 7398 | 2019-02-19 | 2019-02-19 09:36:22 | 1 | Bus |
| 7399 | 2019-02-19 | 2019-02-19 09:35:45 | 1 | Bus |
| 7400 | 2019-02-19 | 2019-02-19 09:36:26 | 1 | Bus |
| 7401 | 2019-02-19 | 2019-02-19 09:35:25 | 1 | Bus |
| 7402 | 2019-02-19 | 2019-02-19 09:35:17 | 1 | Bus |
| 7403 | 2019-02-19 | 2019-02-19 09:37:27 | 1 | Bus |
| 7404 | 2019-02-19 | 2019-02-19 09:35:55 | 1 | Bus |
| 7405 | 2019-02-19 | 2019-02-19 09:38:09 | 1 | Bus |
| 7406 | 2019-02-19 | 2019-02-19 09:36:41 | 1 | Bus |
| 7407 | 2019-02-19 | 2019-02-19 09:38:37 | 1 | Bus |
| 7408 | 2019-02-19 | 2019-02-19 09:37:16 | 1 | Bus |
| 7409 | 2019-02-19 | 2019-02-19 09:37:45 | 1 | Bus |
| 7410 | 2019-02-19 | 2019-02-19 09:35:49 | 1 | Bus |
| 7411 | 2019-02-19 | 2019-02-19 09:35:53 | 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;