View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,926–5,950 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6248 | 2018-07-17 | 2018-07-17 14:29:47 | 2 | Metro |
| 6249 | 2018-07-17 | 2018-07-17 14:15:37 | 1 | Walk |
| 6250 | 2018-07-17 | 2018-07-17 14:15:39 | 1 | Walk |
| 6251 | 2018-07-17 | 2018-07-17 14:16:02 | 1 | Walk |
| 6252 | 2018-07-17 | 2018-07-17 14:15:40 | 1 | Walk |
| 6253 | 2018-07-18 | 2018-07-18 10:05:29 | 2 | Bus |
| 6254 | 2018-07-18 | 2018-07-18 10:05:25 | 2 | Bus |
| 6255 | 2018-07-18 | 2018-07-18 10:05:37 | 2 | Bus |
| 6256 | 2018-07-18 | 2018-07-18 10:05:06 | 2 | Bus |
| 6257 | 2018-07-18 | 2018-07-18 11:52:02 | 3 | Walk |
| 6258 | 2018-07-18 | 2018-07-18 11:52:05 | 3 | Walk |
| 6259 | 2018-07-18 | 2018-07-18 12:23:52 | 1 | Metro |
| 6260 | 2018-07-18 | 2018-07-18 16:43:12 | 2 | Private Vehicle |
| 6261 | 2018-07-18 | 2018-07-18 16:43:11 | 2 | Private Vehicle |
| 6262 | 2018-08-14 | 2018-08-14 12:41:54 | 3 | Walk |
| 6263 | 2018-07-21 | 2018-07-21 15:39:52 | 1 | Metro |
| 6264 | 2018-07-21 | 2018-07-21 15:40:36 | 1 | Metro |
| 6265 | 2018-07-21 | 2018-07-21 15:40:09 | 1 | Metro |
| 6266 | 2018-07-19 | 2018-07-19 09:31:50 | 4 | Walk |
| 6267 | 2018-07-19 | 2018-07-19 09:32:15 | 4 | Walk |
| 6268 | 2018-07-27 | 2018-07-27 14:23:22 | 2 | Private Vehicle |
| 6269 | 2018-07-27 | 2018-07-27 14:22:58 | 2 | Private Vehicle |
| 6270 | 2018-07-20 | 2018-07-20 10:48:44 | 1 | Walk |
| 6271 | 2018-07-21 | 2018-07-21 09:31:35 | 2 | Private Vehicle |
| 6272 | 2018-07-21 | 2018-07-21 09:31:17 | 2 | Private Vehicle |
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;