View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 4,351–4,375 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4591 | 2017-09-24 | 2017-09-24 10:05:13 | 1 | Metro |
| 4592 | 2017-09-24 | 2017-09-24 10:05:08 | 1 | Metro |
| 4593 | 2017-09-24 | 2017-09-24 10:04:44 | 1 | Metro |
| 4594 | 2017-10-10 | 2017-10-10 09:31:21 | 1 | Bus |
| 4595 | 2017-10-10 | 2017-10-10 09:31:26 | 1 | Bus |
| 4596 | 2017-10-10 | 2017-10-10 09:31:45 | 1 | Bus |
| 4597 | 2017-10-10 | 2017-10-10 09:32:00 | 1 | Bus |
| 4598 | 2017-10-10 | 2017-10-10 09:31:37 | 1 | Bus |
| 4599 | 2017-10-10 | 2017-10-10 09:32:11 | 1 | Bus |
| 4600 | 2017-10-10 | 2017-10-10 09:32:15 | 1 | Bus |
| 4601 | 2017-10-10 | 2017-10-10 09:32:31 | 1 | Bus |
| 4602 | 2017-10-10 | 2017-10-10 09:32:09 | 1 | Bus |
| 4603 | 2017-10-10 | 2017-10-10 09:32:24 | 1 | Bus |
| 4604 | 2017-10-10 | 2017-10-10 09:32:21 | 1 | Bus |
| 4605 | 2017-10-10 | 2017-10-10 09:33:33 | 1 | Bus |
| 4606 | 2017-10-10 | 2017-10-10 09:34:09 | 1 | Bus |
| 4607 | 2017-10-10 | 2017-10-10 09:33:18 | 1 | Bus |
| 4608 | 2017-10-10 | 2017-10-10 09:34:51 | 1 | Bus |
| 4609 | 2017-10-10 | 2017-10-10 09:33:06 | 1 | Bus |
| 4610 | 2017-10-10 | 2017-10-10 09:33:13 | 1 | Bus |
| 4611 | 2017-10-10 | 2017-10-10 09:32:29 | 1 | Bus |
| 4612 | 2017-10-10 | 2017-10-10 09:35:51 | 1 | Bus |
| 4613 | 2017-10-10 | 2017-10-10 09:36:06 | 1 | Bus |
| 4614 | 2017-10-10 | 2017-10-10 09:36:01 | 1 | Bus |
| 4615 | 2017-10-10 | 2017-10-10 09:34:09 | 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;