View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,476–6,500 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6809 | 2018-12-09 | 2018-12-09 12:37:29 | 1 | Bus |
| 6810 | 2018-12-09 | 2018-12-09 12:37:19 | 1 | Bus |
| 6811 | 2018-12-09 | 2018-12-09 12:38:15 | 1 | Bus |
| 6812 | 2018-12-09 | 2018-12-09 12:38:23 | 1 | Bus |
| 6813 | 2018-12-09 | 2018-12-09 12:37:15 | 1 | Bus |
| 6814 | 2018-12-09 | 2018-12-09 12:38:39 | 1 | Bus |
| 6815 | 2018-12-09 | 2018-12-09 12:37:23 | 1 | Bus |
| 6816 | 2018-12-09 | 2018-12-09 12:39:17 | 1 | Bus |
| 6817 | 2018-12-09 | 2018-12-09 12:38:40 | 1 | Bus |
| 6818 | 2018-12-09 | 2018-12-09 12:41:59 | 1 | Bus |
| 6819 | 2018-12-09 | 2018-12-09 12:39:19 | 1 | Bus |
| 6820 | 2018-12-09 | 2018-12-09 12:41:11 | 1 | Bus |
| 6821 | 2018-12-09 | 2018-12-09 12:41:50 | 1 | Bus |
| 6823 | 2018-12-09 | 2018-12-09 12:41:35 | 1 | Bus |
| 6824 | 2018-12-09 | 2018-12-09 12:37:55 | 1 | Bus |
| 6825 | 2018-12-09 | 2018-12-09 12:41:29 | 1 | Bus |
| 6826 | 2018-12-09 | 2018-12-09 12:40:07 | 1 | Bus |
| 6827 | 2018-12-09 | 2018-12-09 12:43:59 | 1 | Bus |
| 6828 | 2018-12-09 | 2018-12-09 12:40:56 | 1 | Bus |
| 6829 | 2018-10-07 | 2018-10-07 16:08:20 | 1 | Metro |
| 6830 | 2018-10-07 | 2018-10-07 16:08:21 | 1 | Metro |
| 6831 | 2018-10-13 | 2018-10-13 13:53:32 | 2 | Bus |
| 6832 | 2018-10-03 | 2018-10-03 10:16:25 | 1 | Taxi |
| 6833 | 2018-10-03 | 2018-10-03 10:16:27 | 1 | Taxi |
| 6834 | 2018-10-03 | 2018-10-03 11:00:54 | 1 | Walk |
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;