View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,176–7,200 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7548 | 2019-05-17 | 2019-05-17 10:38:43 | 4 | Bus |
| 7549 | 2019-05-17 | 2019-05-17 10:38:09 | 4 | Bus |
| 7551 | 2019-05-17 | 2019-05-17 10:40:03 | 4 | Bus |
| 7554 | 2019-05-17 | 2019-05-17 10:38:34 | 4 | Bus |
| 7555 | 2019-05-17 | 2019-05-17 10:38:55 | 4 | Bus |
| 7557 | 2019-05-17 | 2019-05-17 10:39:03 | 4 | Bus |
| 7559 | 2019-05-17 | 2019-05-17 10:39:43 | 4 | Bus |
| 7560 | 2019-05-17 | 2019-05-17 10:38:28 | 4 | Bus |
| 7561 | 2019-05-17 | 2019-05-17 10:40:03 | 4 | Bus |
| 7562 | 2019-05-17 | 2019-05-17 10:38:19 | 4 | Bus |
| 7563 | 2019-05-17 | 2019-05-17 10:39:03 | 4 | Bus |
| 7564 | 2019-05-17 | 2019-05-17 10:39:51 | 4 | Bus |
| 7567 | 2019-05-17 | 2019-05-17 10:40:43 | 4 | Bus |
| 7568 | 2019-05-17 | 2019-05-17 10:40:53 | 4 | Bus |
| 7569 | 2019-05-17 | 2019-05-17 10:41:03 | 4 | Bus |
| 7570 | 2019-05-17 | 2019-05-17 10:38:43 | 4 | Bus |
| 7571 | 2019-05-17 | 2019-05-17 10:39:13 | 4 | Bus |
| 7572 | 2019-05-17 | 2019-05-17 10:40:12 | 4 | Bus |
| 7573 | 2019-05-17 | 2019-05-17 10:43:07 | 4 | Bus |
| 7574 | 2019-02-07 | 2019-02-07 12:48:44 | 2 | Metro |
| 7575 | 2019-02-07 | 2019-02-07 12:48:34 | 2 | Metro |
| 7576 | 2019-02-01 | 2019-02-01 11:14:26 | 2 | Metro |
| 7577 | 2019-02-01 | 2019-02-01 11:14:09 | 2 | Metro |
| 7578 | 2019-02-16 | 2019-02-16 14:50:08 | 1 | Walk |
| 7579 | 2019-02-02 | 2019-02-02 15:51:52 | 2 | Metro |
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;