View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,226–3,250 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3412 | 2017-01-22 | 2017-01-22 11:20:24 | 4 | Walk |
| 3413 | 2017-01-26 | 2017-01-26 10:35:50 | 2 | Walk |
| 3414 | 2017-01-26 | 2017-01-26 10:35:55 | 2 | Walk |
| 3415 | 2017-01-26 | 2017-01-26 11:00:50 | 1 | Metro |
| 3416 | 2017-01-26 | 2017-01-26 11:01:00 | 1 | Metro |
| 3417 | 2017-01-26 | 2017-01-26 11:00:57 | 1 | Metro |
| 3418 | 2017-01-26 | 2017-01-26 11:01:26 | 1 | Metro |
| 3419 | 2017-01-26 | 2017-01-26 11:01:30 | 1 | Metro |
| 3420 | 2017-01-20 | 2017-01-20 14:19:55 | 1 | Metro |
| 3421 | 2017-01-20 | 2017-01-20 14:19:42 | 1 | Metro |
| 3422 | 2017-01-20 | 2017-01-20 14:19:24 | 1 | Metro |
| 3423 | 2017-01-24 | 2017-01-24 10:01:46 | 1 | Walk |
| 3424 | 2017-03-16 | 2017-03-16 13:52:16 | 4 | Walk |
| 3425 | 2017-05-03 | 2017-05-03 11:58:25 | 4 | Bus |
| 3426 | 2017-05-03 | 2017-05-03 11:58:33 | 4 | Bus |
| 3428 | 2017-05-03 | 2017-05-03 11:58:33 | 4 | Bus |
| 3429 | 2017-05-03 | 2017-05-03 11:58:55 | 4 | Bus |
| 3430 | 2017-05-03 | 2017-05-03 11:59:25 | 4 | Bus |
| 3431 | 2017-05-03 | 2017-05-03 11:59:00 | 4 | Bus |
| 3432 | 2017-05-03 | 2017-05-03 11:59:13 | 4 | Bus |
| 3433 | 2017-05-03 | 2017-05-03 12:00:03 | 4 | Bus |
| 3434 | 2017-05-03 | 2017-05-03 11:59:45 | 4 | Bus |
| 3435 | 2017-05-03 | 2017-05-03 11:59:01 | 4 | Bus |
| 3437 | 2017-05-03 | 2017-05-03 11:59:15 | 4 | Bus |
| 3438 | 2017-05-03 | 2017-05-03 12:00:48 | 4 | 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;