View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,151–7,175 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7516 | 2019-03-15 | 2019-03-15 13:05:14 | 1 | Metro |
| 7517 | 2019-03-15 | 2019-03-15 13:08:01 | 1 | Metro |
| 7518 | 2019-03-15 | 2019-03-15 13:04:47 | 1 | Metro |
| 7519 | 2019-03-15 | 2019-03-15 13:08:23 | 1 | Metro |
| 7520 | 2019-03-15 | 2019-03-15 13:07:51 | 1 | Metro |
| 7521 | 2019-03-15 | 2019-03-15 13:06:33 | 1 | Metro |
| 7522 | 2019-03-15 | 2019-03-15 13:08:11 | 1 | Metro |
| 7523 | 2019-03-15 | 2019-03-15 13:05:17 | 1 | Metro |
| 7524 | 2019-03-15 | 2019-03-15 13:06:10 | 1 | Metro |
| 7525 | 2019-03-15 | 2019-03-15 13:08:41 | 1 | Metro |
| 7526 | 2019-01-30 | 2019-01-30 11:59:43 | 1 | Walk |
| 7527 | 2019-02-03 | 2019-02-03 11:58:43 | 1 | Walk |
| 7528 | 2019-02-03 | 2019-02-03 11:59:07 | 1 | Walk |
| 7529 | 2019-02-03 | 2019-02-03 11:58:41 | 1 | Walk |
| 7530 | 2019-02-03 | 2019-02-03 11:58:49 | 1 | Walk |
| 7531 | 2019-05-17 | 2019-05-17 10:37:03 | 4 | Bus |
| 7532 | 2019-05-17 | 2019-05-17 10:37:09 | 4 | Bus |
| 7533 | 2019-05-17 | 2019-05-17 10:37:21 | 4 | Bus |
| 7535 | 2019-05-17 | 2019-05-17 10:37:27 | 4 | Bus |
| 7538 | 2019-05-17 | 2019-05-17 10:37:51 | 4 | Bus |
| 7541 | 2019-05-17 | 2019-05-17 10:38:18 | 4 | Bus |
| 7542 | 2019-05-17 | 2019-05-17 10:37:57 | 4 | Bus |
| 7544 | 2019-05-17 | 2019-05-17 10:37:52 | 4 | Bus |
| 7545 | 2019-05-17 | 2019-05-17 10:38:07 | 4 | Bus |
| 7546 | 2019-05-17 | 2019-05-17 10:38:33 | 4 | Bus |
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;