View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,276–5,300 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 5556 | 2018-04-12 | 2018-04-12 14:14:12 | 2 | Bus |
| 5557 | 2018-04-17 | 2018-04-17 12:57:35 | 2 | Other |
| 5558 | 2018-04-13 | 2018-04-13 10:20:27 | 2 | Metro |
| 5559 | 2018-04-13 | 2018-04-13 10:20:10 | 2 | Metro |
| 5560 | 2018-04-13 | 2018-04-13 10:20:36 | 2 | Metro |
| 5561 | 2018-04-22 | 2018-04-22 09:30:20 | 4 | Walk |
| 5562 | 2018-04-18 | 2018-04-18 09:32:19 | 2 | Metro |
| 5563 | 2018-04-18 | 2018-04-18 09:32:01 | 2 | Metro |
| 5564 | 2018-04-14 | 2018-04-14 10:48:26 | 5 | Walk |
| 5565 | 2018-04-14 | 2018-04-14 10:48:15 | 5 | Walk |
| 5566 | 2018-04-14 | 2018-04-14 10:48:25 | 5 | Walk |
| 5567 | 2018-04-14 | 2018-04-14 10:48:05 | 5 | Walk |
| 5568 | 2018-04-14 | 2018-04-14 10:48:32 | 5 | Walk |
| 5569 | 2018-05-02 | 2018-05-02 11:33:26 | 3 | Taxi |
| 5570 | 2018-04-22 | 2018-04-22 11:23:52 | 1 | Train |
| 5571 | 2018-04-22 | 2018-04-22 11:23:46 | 1 | Train |
| 5572 | 2018-04-15 | 2018-04-15 14:36:44 | 4 | Walk |
| 5573 | 2018-04-19 | 2018-04-19 13:02:43 | 1 | Bus |
| 5574 | 2018-05-22 | 2018-05-22 10:54:42 | 2 | Bus |
| 5575 | 2018-05-22 | 2018-05-22 10:55:04 | 2 | Bus |
| 5576 | 2018-05-22 | 2018-05-22 10:55:01 | 2 | Bus |
| 5577 | 2018-05-22 | 2018-05-22 10:54:58 | 2 | Bus |
| 5578 | 2018-05-06 | 2018-05-06 13:16:35 | 1 | Other |
| 5579 | 2018-05-06 | 2018-05-06 13:16:21 | 1 | Other |
| 5580 | 2018-05-06 | 2018-05-06 13:16:50 | 1 | Other |
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;