View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,651–2,675 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2798 | 2016-09-09 | 2016-09-09 15:36:41 | 5 | Walk |
| 2799 | 2016-09-09 | 2016-09-09 15:36:08 | 5 | Walk |
| 2800 | 2016-09-09 | 2016-09-09 15:36:25 | 5 | Walk |
| 2801 | 2016-09-09 | 2016-09-09 15:36:30 | 5 | Walk |
| 2802 | 2016-09-10 | 2016-09-10 13:37:02 | 1 | Walk |
| 2803 | 2016-09-22 | 2016-09-22 15:49:22 | 4 | Walk |
| 2804 | 2016-09-12 | 2016-09-12 11:45:20 | 1 | Bus |
| 2805 | 2016-09-12 | 2016-09-12 11:44:42 | 1 | Bus |
| 2806 | 2016-10-02 | 2016-10-02 11:53:54 | 3 | Walk |
| 2807 | 2016-10-01 | 2016-10-01 10:18:07 | 5 | Bus |
| 2808 | 2016-10-01 | 2016-10-01 10:17:51 | 5 | Bus |
| 2809 | 2016-09-17 | 2016-09-17 10:20:56 | 5 | Walk |
| 2810 | 2016-09-17 | 2016-09-17 10:21:01 | 5 | Walk |
| 2811 | 2016-09-13 | 2016-09-13 09:44:41 | 1 | Walk |
| 2812 | 2016-09-13 | 2016-09-13 14:50:05 | 2 | Other |
| 2813 | 2016-09-15 | 2016-09-15 14:49:47 | 2 | Other |
| 2814 | 2016-09-21 | 2016-09-21 11:03:16 | 1 | Other |
| 2815 | 2016-09-21 | 2016-09-21 11:03:01 | 1 | Other |
| 2816 | 2016-10-12 | 2016-10-12 11:34:58 | 1 | Walk |
| 2817 | 2016-10-12 | 2016-10-12 11:34:29 | 1 | Walk |
| 2818 | 2016-09-18 | 2016-09-18 10:29:49 | 3 | Other |
| 2819 | 2016-09-19 | 2016-09-19 12:35:34 | 3 | Private Vehicle |
| 2820 | 2016-09-19 | 2016-09-19 12:35:32 | 3 | Private Vehicle |
| 2821 | 2016-09-19 | 2016-09-19 12:35:29 | 3 | Private Vehicle |
| 2822 | 2016-09-20 | 2016-09-20 09:27:05 | 2 | Taxi |
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;