View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,251–3,275 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3439 | 2017-05-03 | 2017-05-03 12:01:01 | 4 | Bus |
| 3440 | 2017-05-03 | 2017-05-03 12:00:22 | 4 | Bus |
| 3443 | 2017-05-03 | 2017-05-03 11:59:49 | 4 | Bus |
| 3445 | 2017-05-03 | 2017-05-03 12:00:10 | 4 | Bus |
| 3446 | 2017-05-03 | 2017-05-03 12:01:21 | 4 | Bus |
| 3449 | 2017-05-03 | 2017-05-03 11:59:33 | 4 | Bus |
| 3450 | 2017-05-03 | 2017-05-03 12:02:55 | 4 | Bus |
| 3451 | 2017-05-03 | 2017-05-03 12:02:51 | 4 | Bus |
| 3452 | 2017-05-03 | 2017-05-03 12:02:05 | 4 | Bus |
| 3454 | 2017-05-03 | 2017-05-03 11:59:49 | 4 | Bus |
| 3455 | 2017-05-03 | 2017-05-03 12:02:27 | 4 | Bus |
| 3456 | 2017-05-03 | 2017-05-03 12:00:43 | 4 | Bus |
| 3457 | 2017-05-03 | 2017-05-03 12:00:25 | 4 | Bus |
| 3458 | 2017-05-03 | 2017-05-03 12:00:05 | 4 | Bus |
| 3459 | 2017-05-03 | 2017-05-03 12:01:53 | 4 | Bus |
| 3460 | 2017-05-03 | 2017-05-03 12:04:16 | 4 | Bus |
| 3461 | 2017-05-03 | 2017-05-03 12:04:01 | 4 | Bus |
| 3462 | 2017-05-03 | 2017-05-03 12:04:13 | 4 | Bus |
| 3464 | 2017-05-03 | 2017-05-03 12:05:55 | 4 | Bus |
| 3465 | 2017-05-03 | 2017-05-03 12:04:06 | 4 | Bus |
| 3466 | 2017-05-03 | 2017-05-03 12:04:17 | 4 | Bus |
| 3469 | 2017-05-03 | 2017-05-03 12:01:10 | 4 | Bus |
| 3470 | 2017-05-03 | 2017-05-03 12:04:05 | 4 | Bus |
| 3471 | 2017-01-23 | 2017-01-23 12:08:28 | 1 | Walk |
| 3472 | 2017-01-23 | 2017-01-23 12:07:50 | 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;