View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 4,326–4,350 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4566 | 2017-09-18 | 2017-09-18 15:07:56 | 2 | Metro |
| 4567 | 2017-09-11 | 2017-09-11 10:48:46 | 5 | Metro |
| 4568 | 2017-09-11 | 2017-09-11 10:48:21 | 5 | Metro |
| 4569 | 2017-09-11 | 2017-09-11 10:48:41 | 5 | Metro |
| 4570 | 2017-09-11 | 2017-09-11 16:09:11 | 4 | Private Vehicle |
| 4571 | 2017-09-26 | 2017-09-26 10:50:08 | 1 | Train |
| 4572 | 2017-09-26 | 2017-09-26 10:49:40 | 1 | Train |
| 4573 | 2017-09-24 | 2017-09-24 11:49:08 | 1 | Bus |
| 4574 | 2017-09-24 | 2017-09-24 11:49:09 | 1 | Bus |
| 4575 | 2017-09-24 | 2017-09-24 11:49:53 | 1 | Bus |
| 4576 | 2017-09-24 | 2017-09-24 11:49:10 | 1 | Bus |
| 4577 | 2017-09-16 | 2017-09-16 10:07:03 | 3 | Metro |
| 4578 | 2017-09-16 | 2017-09-16 10:06:28 | 3 | Metro |
| 4579 | 2017-09-16 | 2017-09-16 10:07:04 | 3 | Metro |
| 4580 | 2017-09-16 | 2017-09-16 10:06:49 | 3 | Metro |
| 4581 | 2017-09-13 | 2017-09-13 10:34:56 | 2 | Private Vehicle |
| 4582 | 2017-09-13 | 2017-09-13 10:35:10 | 2 | Private Vehicle |
| 4583 | 2017-09-13 | 2017-09-13 10:35:23 | 2 | Private Vehicle |
| 4584 | 2017-09-13 | 2017-09-13 10:35:06 | 2 | Private Vehicle |
| 4585 | 2017-09-13 | 2017-09-13 10:35:37 | 2 | Private Vehicle |
| 4586 | 2017-09-13 | 2017-09-13 16:57:25 | 2 | Metro |
| 4587 | 2017-09-13 | 2017-09-13 16:57:56 | 2 | Metro |
| 4588 | 2017-09-15 | 2017-09-15 10:16:47 | 2 | Private Vehicle |
| 4589 | 2017-09-15 | 2017-09-15 10:16:34 | 2 | Private Vehicle |
| 4590 | 2017-09-24 | 2017-09-24 10:05:05 | 1 | 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;