View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,451–3,475 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3655 | 2017-07-02 | 2017-07-02 10:00:29 | 4 | Bus |
| 3656 | 2017-07-02 | 2017-07-02 10:00:53 | 4 | Bus |
| 3657 | 2017-07-02 | 2017-07-02 09:59:49 | 4 | Bus |
| 3658 | 2017-07-02 | 2017-07-02 10:00:59 | 4 | Bus |
| 3659 | 2017-07-02 | 2017-07-02 10:02:34 | 4 | Bus |
| 3661 | 2017-07-02 | 2017-07-02 10:01:55 | 4 | Bus |
| 3662 | 2017-07-02 | 2017-07-02 10:01:29 | 4 | Bus |
| 3663 | 2017-07-02 | 2017-07-02 10:01:39 | 4 | Bus |
| 3664 | 2017-07-02 | 2017-07-02 10:00:25 | 4 | Bus |
| 3665 | 2017-07-02 | 2017-07-02 10:00:09 | 4 | Bus |
| 3666 | 2017-07-02 | 2017-07-02 10:04:04 | 4 | Bus |
| 3668 | 2017-07-02 | 2017-07-02 10:04:19 | 4 | Bus |
| 3669 | 2017-07-02 | 2017-07-02 10:04:34 | 4 | Bus |
| 3670 | 2017-07-02 | 2017-07-02 10:04:49 | 4 | Bus |
| 3671 | 2017-07-02 | 2017-07-02 10:04:37 | 4 | Bus |
| 3672 | 2017-07-02 | 2017-07-02 10:04:23 | 4 | Bus |
| 3673 | 2017-07-02 | 2017-07-02 10:02:11 | 4 | Bus |
| 3674 | 2017-07-02 | 2017-07-02 10:02:19 | 4 | Bus |
| 3675 | 2017-07-02 | 2017-07-02 10:02:27 | 4 | Bus |
| 3676 | 2017-07-02 | 2017-07-02 10:03:07 | 4 | Bus |
| 3677 | 2017-07-02 | 2017-07-02 10:04:55 | 4 | Bus |
| 3678 | 2017-07-02 | 2017-07-02 10:01:43 | 4 | Bus |
| 3679 | 2017-07-02 | 2017-07-02 10:00:39 | 4 | Bus |
| 3680 | 2017-07-02 | 2017-07-02 10:04:19 | 4 | Bus |
| 3681 | 2017-04-06 | 2017-04-06 10:46:54 | 2 | 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;