View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 4,726–4,750 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4982 | 2017-12-23 | 2017-12-23 10:45:03 | 2 | Private Vehicle |
| 4983 | 2017-12-23 | 2017-12-23 10:45:26 | 2 | Private Vehicle |
| 4984 | 2017-12-23 | 2017-12-23 10:45:00 | 2 | Private Vehicle |
| 4985 | 2017-12-23 | 2017-12-23 10:45:14 | 2 | Private Vehicle |
| 4986 | 2017-12-24 | 2017-12-24 11:59:55 | 1 | Taxi |
| 4987 | 2017-12-24 | 2017-12-24 11:59:47 | 1 | Taxi |
| 4988 | 2017-12-24 | 2017-12-24 10:02:15 | 2 | Walk |
| 4989 | 2017-12-24 | 2017-12-24 10:02:15 | 2 | Walk |
| 4990 | 2017-12-25 | 2017-12-25 15:56:07 | 1 | Walk |
| 4991 | 2017-12-25 | 2017-12-25 15:55:42 | 1 | Walk |
| 4992 | 2017-12-31 | 2017-12-31 11:45:55 | 5 | Taxi |
| 4993 | 2018-01-19 | 2018-01-19 13:04:09 | 1 | Metro |
| 4994 | 2018-01-19 | 2018-01-19 13:04:17 | 1 | Metro |
| 4995 | 2018-01-19 | 2018-01-19 13:04:33 | 1 | Metro |
| 4996 | 2018-01-19 | 2018-01-19 13:04:45 | 1 | Metro |
| 4997 | 2018-01-19 | 2018-01-19 13:04:41 | 1 | Metro |
| 4998 | 2018-01-19 | 2018-01-19 13:05:04 | 1 | Metro |
| 4999 | 2018-01-19 | 2018-01-19 13:05:03 | 1 | Metro |
| 5000 | 2018-01-19 | 2018-01-19 13:04:58 | 1 | Metro |
| 5001 | 2018-01-19 | 2018-01-19 13:05:37 | 1 | Metro |
| 5002 | 2018-01-19 | 2018-01-19 13:05:21 | 1 | Metro |
| 5003 | 2018-01-19 | 2018-01-19 13:05:09 | 1 | Metro |
| 5004 | 2018-01-19 | 2018-01-19 13:05:48 | 1 | Metro |
| 5005 | 2018-01-19 | 2018-01-19 13:04:57 | 1 | Metro |
| 5006 | 2018-01-19 | 2018-01-19 13:05:53 | 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;