View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,951–6,975 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7303 | 2019-04-02 | 2019-04-02 10:01:24 | 1 | Bus |
| 7305 | 2019-04-02 | 2019-04-02 10:01:26 | 1 | Bus |
| 7308 | 2019-04-02 | 2019-04-02 10:01:58 | 1 | Bus |
| 7309 | 2019-04-02 | 2019-04-02 10:02:00 | 1 | Bus |
| 7310 | 2019-04-02 | 2019-04-02 10:01:50 | 1 | Bus |
| 7311 | 2019-04-02 | 2019-04-02 10:02:31 | 1 | Bus |
| 7312 | 2019-04-02 | 2019-04-02 10:01:42 | 1 | Bus |
| 7314 | 2019-04-02 | 2019-04-02 10:02:14 | 1 | Bus |
| 7315 | 2019-04-02 | 2019-04-02 10:02:36 | 1 | Bus |
| 7318 | 2019-04-02 | 2019-04-02 10:01:45 | 1 | Bus |
| 7319 | 2019-04-02 | 2019-04-02 10:04:14 | 1 | Bus |
| 7320 | 2019-04-02 | 2019-04-02 10:03:37 | 1 | Bus |
| 7321 | 2019-04-02 | 2019-04-02 10:03:12 | 1 | Bus |
| 7322 | 2019-04-02 | 2019-04-02 10:02:43 | 1 | Bus |
| 7324 | 2019-04-02 | 2019-04-02 10:03:30 | 1 | Bus |
| 7325 | 2019-04-02 | 2019-04-02 10:05:45 | 1 | Bus |
| 7327 | 2019-04-02 | 2019-04-02 10:04:54 | 1 | Bus |
| 7328 | 2019-04-02 | 2019-04-02 10:03:57 | 1 | Bus |
| 7329 | 2018-12-24 | 2018-12-24 11:14:33 | 2 | Metro |
| 7331 | 2019-01-04 | 2019-01-04 12:50:12 | 1 | Taxi |
| 7332 | 2018-12-25 | 2018-12-25 14:31:27 | 5 | Walk |
| 7333 | 2018-12-25 | 2018-12-25 14:31:00 | 5 | Walk |
| 7334 | 2018-12-25 | 2018-12-25 14:31:25 | 5 | Walk |
| 7335 | 2018-12-22 | 2018-12-22 10:17:38 | 1 | Bus |
| 7336 | 2018-12-22 | 2018-12-22 10:17:56 | 1 | 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;