View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,276–6,300 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6602 | 2018-09-02 | 2018-09-02 09:58:22 | 5 | Walk |
| 6603 | 2018-09-02 | 2018-09-02 09:58:02 | 5 | Walk |
| 6604 | 2018-09-02 | 2018-09-02 10:26:04 | 1 | Walk |
| 6605 | 2018-09-02 | 2018-09-02 10:26:12 | 1 | Walk |
| 6606 | 2018-09-02 | 2018-09-02 10:26:06 | 1 | Walk |
| 6607 | 2018-09-02 | 2018-09-02 10:26:43 | 1 | Walk |
| 6608 | 2018-09-02 | 2018-09-02 10:26:44 | 1 | Walk |
| 6609 | 2018-09-18 | 2018-09-18 16:45:09 | 1 | Taxi |
| 6610 | 2018-09-18 | 2018-09-18 16:45:43 | 1 | Taxi |
| 6611 | 2018-09-04 | 2018-09-04 15:29:14 | 2 | Metro |
| 6612 | 2018-09-04 | 2018-09-04 15:29:26 | 2 | Metro |
| 6613 | 2018-09-04 | 2018-09-04 11:26:35 | 1 | Walk |
| 6614 | 2018-09-05 | 2018-09-05 11:20:20 | 2 | Metro |
| 6615 | 2018-09-05 | 2018-09-05 11:20:06 | 2 | Metro |
| 6616 | 2018-09-05 | 2018-09-05 10:52:57 | 4 | Bus |
| 6617 | 2018-09-05 | 2018-09-05 10:53:26 | 4 | Bus |
| 6618 | 2018-09-05 | 2018-09-05 11:38:43 | 3 | Metro |
| 6619 | 2018-09-06 | 2018-09-06 14:30:59 | 2 | Bus |
| 6620 | 2018-09-06 | 2018-09-06 14:30:59 | 2 | Bus |
| 6621 | 2018-09-27 | 2018-09-27 10:50:12 | 2 | Private Vehicle |
| 6622 | 2018-09-27 | 2018-09-27 10:50:10 | 2 | Private Vehicle |
| 6623 | 2018-09-27 | 2018-09-27 10:50:31 | 2 | Private Vehicle |
| 6624 | 2018-09-27 | 2018-09-27 10:50:09 | 2 | Private Vehicle |
| 6625 | 2018-12-24 | 2018-12-24 10:22:56 | 1 | Bus |
| 6626 | 2018-12-24 | 2018-12-24 10:23:07 | 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;