View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 51–75 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 51 | 2015-04-25 | 2015-04-25 10:52:05 | 4 | Bus |
| 52 | 2015-04-25 | 2015-04-25 10:50:49 | 4 | Bus |
| 53 | 2015-04-25 | 2015-04-25 10:54:44 | 4 | Bus |
| 54 | 2015-04-25 | 2015-04-25 10:52:41 | 4 | Bus |
| 55 | 2015-04-25 | 2015-04-25 10:52:06 | 4 | Bus |
| 56 | 2015-04-25 | 2015-04-25 10:49:53 | 4 | Bus |
| 57 | 2015-04-25 | 2015-04-25 10:50:50 | 4 | Bus |
| 58 | 2015-04-25 | 2015-04-25 10:54:19 | 4 | Bus |
| 59 | 2015-04-25 | 2015-04-25 10:52:50 | 4 | Bus |
| 60 | 2015-04-25 | 2015-04-25 10:54:45 | 4 | Bus |
| 61 | 2015-04-25 | 2015-04-25 10:51:26 | 4 | Bus |
| 62 | 2015-04-25 | 2015-04-25 10:51:35 | 4 | Bus |
| 63 | 2015-04-25 | 2015-04-25 10:52:39 | 4 | Bus |
| 64 | 2015-04-25 | 2015-04-25 10:55:37 | 4 | Bus |
| 65 | 2015-04-25 | 2015-04-25 10:48:14 | 4 | Bus |
| 66 | 2015-03-09 | 2015-03-09 11:47:13 | 3 | Metro |
| 67 | 2015-03-09 | 2015-03-09 11:46:51 | 3 | Metro |
| 68 | 2015-03-01 | 2015-03-01 10:22:54 | 1 | Walk |
| 69 | 2015-03-01 | 2015-03-01 10:23:25 | 1 | Walk |
| 70 | 2015-03-01 | 2015-03-01 10:23:05 | 1 | Walk |
| 71 | 2015-03-01 | 2015-03-01 10:23:06 | 1 | Walk |
| 72 | 2015-03-03 | 2015-03-03 11:45:33 | 2 | Train |
| 73 | 2015-03-02 | 2015-03-02 10:16:07 | 1 | Bus |
| 74 | 2015-03-02 | 2015-03-02 10:16:18 | 1 | Bus |
| 75 | 2015-03-14 | 2015-03-14 13:16:33 | 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;