View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,826–2,850 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2981 | 2016-12-26 | 2016-12-26 09:43:37 | 4 | Bus |
| 2982 | 2016-12-26 | 2016-12-26 09:40:41 | 4 | Bus |
| 2984 | 2016-12-26 | 2016-12-26 09:43:35 | 4 | Bus |
| 2985 | 2016-12-26 | 2016-12-26 09:44:16 | 4 | Bus |
| 2986 | 2016-12-26 | 2016-12-26 09:39:59 | 4 | Bus |
| 2987 | 2016-12-26 | 2016-12-26 09:44:11 | 4 | Bus |
| 2989 | 2016-12-26 | 2016-12-26 09:41:11 | 4 | Bus |
| 2991 | 2016-11-08 | 2016-11-08 11:32:43 | 3 | Walk |
| 2992 | 2016-11-08 | 2016-11-08 11:32:36 | 3 | Walk |
| 2993 | 2016-11-13 | 2016-11-13 10:31:17 | 4 | Metro |
| 2994 | 2016-11-13 | 2016-11-13 10:31:32 | 4 | Metro |
| 2995 | 2016-11-05 | 2016-11-05 10:57:56 | 1 | Walk |
| 2996 | 2016-11-05 | 2016-11-05 10:58:15 | 1 | Walk |
| 2997 | 2016-11-10 | 2016-11-10 11:40:45 | 1 | Bus |
| 2998 | 2016-11-14 | 2016-11-14 12:01:26 | 1 | Walk |
| 2999 | 2016-11-14 | 2016-11-14 12:01:27 | 1 | Walk |
| 3000 | 2016-11-07 | 2016-11-07 09:20:21 | 1 | Train |
| 3001 | 2016-11-07 | 2016-11-07 09:19:55 | 1 | Train |
| 3002 | 2016-11-07 | 2016-11-07 09:20:20 | 1 | Train |
| 3003 | 2016-11-09 | 2016-11-09 11:55:53 | 1 | Other |
| 3004 | 2016-11-09 | 2016-11-09 11:55:51 | 1 | Other |
| 3005 | 2016-11-08 | 2016-11-08 11:42:33 | 4 | Walk |
| 3006 | 2016-11-08 | 2016-11-08 11:42:06 | 4 | Walk |
| 3007 | 2016-11-08 | 2016-11-08 11:42:26 | 4 | Walk |
| 3008 | 2016-11-08 | 2016-11-08 11:42:09 | 4 | 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;