View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,426–3,450 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3625 | 2017-03-25 | 2017-03-25 11:07:53 | 1 | Bus |
| 3626 | 2017-03-20 | 2017-03-20 11:13:47 | 1 | Bus |
| 3627 | 2017-03-20 | 2017-03-20 11:13:39 | 1 | Bus |
| 3628 | 2017-03-20 | 2017-03-20 11:13:38 | 1 | Bus |
| 3629 | 2017-03-20 | 2017-03-20 11:15:57 | 2 | Other |
| 3630 | 2017-03-17 | 2017-03-17 14:40:08 | 2 | Other |
| 3631 | 2017-03-18 | 2017-03-18 11:47:43 | 1 | Walk |
| 3632 | 2017-03-25 | 2017-03-25 15:20:07 | 4 | Other |
| 3633 | 2017-03-25 | 2017-03-25 15:19:48 | 4 | Other |
| 3634 | 2017-04-21 | 2017-04-21 14:50:32 | 4 | Walk |
| 3635 | 2017-04-21 | 2017-04-21 14:49:58 | 4 | Walk |
| 3636 | 2017-04-21 | 2017-04-21 14:50:30 | 4 | Walk |
| 3637 | 2017-07-02 | 2017-07-02 09:58:19 | 4 | Bus |
| 3638 | 2017-07-02 | 2017-07-02 09:58:28 | 4 | Bus |
| 3639 | 2017-07-02 | 2017-07-02 09:58:43 | 4 | Bus |
| 3640 | 2017-07-02 | 2017-07-02 09:58:52 | 4 | Bus |
| 3641 | 2017-07-02 | 2017-07-02 09:59:11 | 4 | Bus |
| 3644 | 2017-07-02 | 2017-07-02 09:58:39 | 4 | Bus |
| 3645 | 2017-07-02 | 2017-07-02 09:59:31 | 4 | Bus |
| 3646 | 2017-07-02 | 2017-07-02 09:59:29 | 4 | Bus |
| 3647 | 2017-07-02 | 2017-07-02 09:59:07 | 4 | Bus |
| 3648 | 2017-07-02 | 2017-07-02 09:59:58 | 4 | Bus |
| 3649 | 2017-07-02 | 2017-07-02 10:00:39 | 4 | Bus |
| 3651 | 2017-07-02 | 2017-07-02 09:59:47 | 4 | Bus |
| 3653 | 2017-07-02 | 2017-07-02 09:59:19 | 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;