View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,826–5,850 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6144 | 2018-10-25 | 2018-10-25 10:00:13 | 4 | Bus |
| 6145 | 2018-10-25 | 2018-10-25 10:04:52 | 4 | Bus |
| 6146 | 2018-10-25 | 2018-10-25 10:00:21 | 4 | Bus |
| 6147 | 2018-10-25 | 2018-10-25 10:00:25 | 4 | Bus |
| 6148 | 2018-10-25 | 2018-10-25 10:03:17 | 4 | Bus |
| 6149 | 2018-10-25 | 2018-10-25 10:00:33 | 4 | Bus |
| 6151 | 2018-10-25 | 2018-10-25 10:01:07 | 4 | Bus |
| 6152 | 2018-10-25 | 2018-10-25 10:01:12 | 4 | Bus |
| 6154 | 2018-10-25 | 2018-10-25 10:05:01 | 4 | Bus |
| 6155 | 2018-10-25 | 2018-10-25 10:05:46 | 4 | Bus |
| 6157 | 2018-10-25 | 2018-10-25 10:06:33 | 4 | Bus |
| 6158 | 2018-10-25 | 2018-10-25 10:05:37 | 4 | Bus |
| 6159 | 2018-10-25 | 2018-10-25 10:01:37 | 4 | Bus |
| 6160 | 2018-10-25 | 2018-10-25 10:02:19 | 4 | Bus |
| 6161 | 2018-10-25 | 2018-10-25 10:06:13 | 4 | Bus |
| 6162 | 2018-10-25 | 2018-10-25 10:04:28 | 4 | Bus |
| 6163 | 2018-10-25 | 2018-10-25 10:06:37 | 4 | Bus |
| 6164 | 2018-10-25 | 2018-10-25 10:04:46 | 4 | Bus |
| 6165 | 2018-10-25 | 2018-10-25 10:05:37 | 4 | Bus |
| 6166 | 2018-07-01 | 2018-07-01 10:55:13 | 1 | Walk |
| 6167 | 2018-07-01 | 2018-07-01 10:54:46 | 1 | Walk |
| 6168 | 2018-07-12 | 2018-07-12 10:24:49 | 1 | Metro |
| 6169 | 2018-07-12 | 2018-07-12 10:25:23 | 1 | Metro |
| 6170 | 2018-07-02 | 2018-07-02 16:47:59 | 2 | Metro |
| 6171 | 2018-07-06 | 2018-07-06 14:15:56 | 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;