View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,326–7,350 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7718 | 2019-02-22 | 2019-02-22 13:47:54 | 1 | Walk |
| 7719 | 2019-02-25 | 2019-02-25 15:22:36 | 5 | Walk |
| 7720 | 2019-02-23 | 2019-02-23 09:47:00 | 2 | Bus |
| 7721 | 2019-02-23 | 2019-02-23 09:47:24 | 2 | Bus |
| 7722 | 2019-03-17 | 2019-03-17 10:26:51 | 4 | Metro |
| 7723 | 2019-03-17 | 2019-03-17 10:26:30 | 4 | Metro |
| 7724 | 2019-02-24 | 2019-02-24 11:32:55 | 2 | Taxi |
| 7725 | 2019-02-24 | 2019-02-24 11:32:46 | 2 | Taxi |
| 7728 | 2019-03-28 | 2019-03-28 10:32:40 | 2 | Walk |
| 7729 | 2019-03-06 | 2019-03-06 16:15:30 | 2 | Metro |
| 7730 | 2019-03-06 | 2019-03-06 16:15:50 | 2 | Metro |
| 7731 | 2019-03-08 | 2019-03-08 09:08:00 | 5 | Walk |
| 7732 | 2019-03-08 | 2019-03-08 09:08:01 | 5 | Walk |
| 7733 | 2019-03-08 | 2019-03-08 09:08:27 | 5 | Walk |
| 7734 | 2019-03-08 | 2019-03-08 09:08:06 | 5 | Walk |
| 7735 | 2019-03-08 | 2019-03-08 09:08:02 | 5 | Walk |
| 7736 | 2019-03-01 | 2019-03-01 11:01:54 | 1 | Private Vehicle |
| 7737 | 2019-03-01 | 2019-03-01 11:01:56 | 1 | Private Vehicle |
| 7738 | 2019-03-01 | 2019-03-01 11:02:06 | 1 | Private Vehicle |
| 7739 | 2019-03-12 | 2019-03-12 10:50:19 | 2 | Metro |
| 7740 | 2019-03-11 | 2019-03-11 10:13:15 | 1 | Walk |
| 7741 | 2019-03-02 | 2019-03-02 10:38:58 | 5 | Bus |
| 7742 | 2019-03-02 | 2019-03-02 10:39:00 | 5 | Bus |
| 7743 | 2019-03-02 | 2019-03-02 10:38:45 | 5 | Bus |
| 7744 | 2019-03-02 | 2019-03-02 10:39:05 | 5 | 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;