View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,026–2,050 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2138 | 2016-05-04 | 2016-05-04 10:51:54 | 2 | Metro |
| 2139 | 2016-05-04 | 2016-05-04 12:54:14 | 1 | Metro |
| 2140 | 2016-05-25 | 2016-05-25 10:26:54 | 1 | Walk |
| 2141 | 2016-05-25 | 2016-05-25 10:26:59 | 1 | Walk |
| 2142 | 2016-05-25 | 2016-05-25 10:26:57 | 1 | Walk |
| 2143 | 2016-05-06 | 2016-05-06 14:01:13 | 2 | Metro |
| 2144 | 2016-05-06 | 2016-05-06 15:58:52 | 3 | Walk |
| 2145 | 2016-05-07 | 2016-05-07 13:30:06 | 3 | Walk |
| 2146 | 2016-05-29 | 2016-05-29 11:59:21 | 4 | Bus |
| 2148 | 2016-05-29 | 2016-05-29 11:59:25 | 4 | Bus |
| 2149 | 2016-05-29 | 2016-05-29 11:59:31 | 4 | Bus |
| 2150 | 2016-05-29 | 2016-05-29 11:59:51 | 4 | Bus |
| 2151 | 2016-05-29 | 2016-05-29 11:59:57 | 4 | Bus |
| 2152 | 2016-05-29 | 2016-05-29 12:00:21 | 4 | Bus |
| 2153 | 2016-05-29 | 2016-05-29 12:00:03 | 4 | Bus |
| 2155 | 2016-05-29 | 2016-05-29 12:00:59 | 4 | Bus |
| 2156 | 2016-05-29 | 2016-05-29 11:59:53 | 4 | Bus |
| 2157 | 2016-05-29 | 2016-05-29 12:01:00 | 4 | Bus |
| 2158 | 2016-05-29 | 2016-05-29 12:01:11 | 4 | Bus |
| 2160 | 2016-05-29 | 2016-05-29 12:00:38 | 4 | Bus |
| 2161 | 2016-05-29 | 2016-05-29 12:02:21 | 4 | Bus |
| 2162 | 2016-05-29 | 2016-05-29 12:00:39 | 4 | Bus |
| 2163 | 2016-05-29 | 2016-05-29 12:01:13 | 4 | Bus |
| 2164 | 2016-05-29 | 2016-05-29 12:03:06 | 4 | Bus |
| 2166 | 2016-05-29 | 2016-05-29 12:03:21 | 4 | 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;