View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,651–3,675 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3872 | 2017-05-06 | 2017-05-06 15:06:19 | 2 | Private Vehicle |
| 3873 | 2017-05-05 | 2017-05-05 11:14:45 | 2 | Bus |
| 3874 | 2017-05-05 | 2017-05-05 11:14:38 | 2 | Bus |
| 3875 | 2017-05-05 | 2017-05-05 11:15:00 | 2 | Bus |
| 3876 | 2017-05-05 | 2017-05-05 11:15:02 | 2 | Bus |
| 3877 | 2017-05-02 | 2017-05-02 09:56:45 | 1 | Walk |
| 3878 | 2017-05-02 | 2017-05-02 09:56:40 | 1 | Walk |
| 3879 | 2017-05-02 | 2017-05-02 10:22:55 | 1 | Walk |
| 3880 | 2017-05-06 | 2017-05-06 09:31:14 | 4 | Bus |
| 3881 | 2017-05-06 | 2017-05-06 09:31:28 | 4 | Bus |
| 3882 | 2017-05-06 | 2017-05-06 09:31:14 | 4 | Bus |
| 3883 | 2017-05-06 | 2017-05-06 09:30:59 | 4 | Bus |
| 3884 | 2017-05-06 | 2017-05-06 09:31:15 | 4 | Bus |
| 3885 | 2017-05-04 | 2017-05-04 11:27:45 | 2 | Taxi |
| 3886 | 2017-05-05 | 2017-05-05 11:09:41 | 5 | Bus |
| 3887 | 2017-05-18 | 2017-05-18 11:26:09 | 3 | Metro |
| 3888 | 2017-05-18 | 2017-05-18 11:25:52 | 3 | Metro |
| 3889 | 2017-05-18 | 2017-05-18 11:25:48 | 3 | Metro |
| 3890 | 2017-05-18 | 2017-05-18 11:25:30 | 3 | Metro |
| 3891 | 2017-05-06 | 2017-05-06 15:07:19 | 2 | Metro |
| 3892 | 2017-05-07 | 2017-05-07 16:32:32 | 1 | Metro |
| 3893 | 2017-05-07 | 2017-05-07 16:32:59 | 1 | Metro |
| 3894 | 2017-05-07 | 2017-05-07 16:33:00 | 1 | Metro |
| 3895 | 2017-05-23 | 2017-05-23 12:28:18 | 1 | Metro |
| 3896 | 2017-05-23 | 2017-05-23 12:28:39 | 1 | 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;