View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,926–6,950 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7272 | 2018-12-14 | 2018-12-14 11:49:42 | 2 | Metro |
| 7273 | 2018-12-16 | 2018-12-16 12:47:51 | 1 | Metro |
| 7274 | 2018-12-16 | 2018-12-16 12:48:27 | 1 | Metro |
| 7275 | 2018-12-16 | 2018-12-16 12:48:13 | 1 | Metro |
| 7276 | 2018-12-16 | 2018-12-16 12:48:37 | 1 | Metro |
| 7277 | 2018-12-16 | 2018-12-16 11:09:04 | 1 | Walk |
| 7278 | 2018-12-16 | 2018-12-16 11:09:22 | 1 | Walk |
| 7279 | 2018-12-19 | 2018-12-19 12:34:23 | 1 | Taxi |
| 7280 | 2018-12-20 | 2018-12-20 10:48:34 | 3 | Metro |
| 7282 | 2018-12-16 | 2018-12-16 16:40:50 | 2 | Walk |
| 7283 | 2018-12-18 | 2018-12-18 10:06:10 | 2 | Metro |
| 7284 | 2018-12-23 | 2018-12-23 13:49:28 | 3 | Bus |
| 7285 | 2018-12-19 | 2018-12-19 09:12:32 | 2 | Private Vehicle |
| 7286 | 2018-12-19 | 2018-12-19 09:12:31 | 2 | Private Vehicle |
| 7287 | 2018-12-30 | 2018-12-30 13:56:14 | 1 | Other |
| 7288 | 2018-12-30 | 2018-12-30 13:55:44 | 1 | Other |
| 7289 | 2018-12-19 | 2018-12-19 14:08:12 | 2 | Private Vehicle |
| 7290 | 2018-12-20 | 2018-12-20 09:41:02 | 1 | Metro |
| 7291 | 2018-12-20 | 2018-12-20 09:40:49 | 1 | Metro |
| 7294 | 2019-04-02 | 2019-04-02 10:00:30 | 1 | Bus |
| 7296 | 2019-04-02 | 2019-04-02 10:00:40 | 1 | Bus |
| 7297 | 2019-04-02 | 2019-04-02 10:00:54 | 1 | Bus |
| 7298 | 2019-04-02 | 2019-04-02 10:01:12 | 1 | Bus |
| 7301 | 2019-04-02 | 2019-04-02 10:00:50 | 1 | Bus |
| 7302 | 2019-04-02 | 2019-04-02 10:00:50 | 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;