View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,901–5,925 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6223 | 2018-07-15 | 2018-07-15 11:59:25 | 1 | Walk |
| 6224 | 2018-07-30 | 2018-07-30 13:14:07 | 1 | Metro |
| 6225 | 2018-07-15 | 2018-07-15 11:15:23 | 2 | Taxi |
| 6226 | 2018-07-15 | 2018-07-15 12:05:57 | 1 | Taxi |
| 6227 | 2018-07-15 | 2018-07-15 12:05:27 | 1 | Taxi |
| 6228 | 2018-07-15 | 2018-07-15 14:11:29 | 2 | Private Vehicle |
| 6229 | 2018-07-15 | 2018-07-15 14:12:05 | 2 | Private Vehicle |
| 6230 | 2018-07-15 | 2018-07-15 14:12:02 | 2 | Private Vehicle |
| 6231 | 2018-07-22 | 2018-07-22 10:13:35 | 5 | Taxi |
| 6232 | 2018-07-22 | 2018-07-22 10:13:26 | 5 | Taxi |
| 6233 | 2018-07-22 | 2018-07-22 10:13:58 | 5 | Taxi |
| 6234 | 2018-07-22 | 2018-07-22 10:14:00 | 5 | Taxi |
| 6235 | 2018-07-22 | 2018-07-22 10:13:40 | 5 | Taxi |
| 6236 | 2018-07-27 | 2018-07-27 12:01:41 | 1 | Metro |
| 6237 | 2018-07-17 | 2018-07-17 13:10:23 | 2 | Metro |
| 6238 | 2018-07-17 | 2018-07-17 13:09:47 | 2 | Metro |
| 6239 | 2018-07-17 | 2018-07-17 13:09:48 | 2 | Metro |
| 6240 | 2018-07-17 | 2018-07-17 13:09:44 | 2 | Metro |
| 6241 | 2018-07-17 | 2018-07-17 09:13:22 | 4 | Other |
| 6242 | 2018-07-17 | 2018-07-17 09:14:01 | 4 | Other |
| 6243 | 2018-07-17 | 2018-07-17 09:13:41 | 4 | Other |
| 6244 | 2018-08-18 | 2018-08-18 14:56:43 | 1 | Walk |
| 6245 | 2018-08-18 | 2018-08-18 14:56:47 | 1 | Walk |
| 6246 | 2018-08-18 | 2018-08-18 14:56:48 | 1 | Walk |
| 6247 | 2018-08-18 | 2018-08-18 14:56:38 | 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;