View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 151–175 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 166 | 2015-03-24 | 2015-03-24 11:07:03 | 2 | Metro |
| 167 | 2015-03-24 | 2015-03-24 11:07:02 | 2 | Metro |
| 168 | 2015-03-24 | 2015-03-24 11:06:41 | 2 | Metro |
| 169 | 2015-03-24 | 2015-03-24 11:06:59 | 2 | Metro |
| 170 | 2015-03-31 | 2015-03-31 14:11:46 | 4 | Taxi |
| 171 | 2015-03-31 | 2015-03-31 14:11:44 | 4 | Taxi |
| 172 | 2015-06-30 | 2015-06-30 13:46:01 | 1 | Bus |
| 173 | 2015-06-30 | 2015-06-30 13:46:15 | 1 | Bus |
| 174 | 2015-06-30 | 2015-06-30 13:46:29 | 1 | Bus |
| 175 | 2015-06-30 | 2015-06-30 13:46:34 | 1 | Bus |
| 176 | 2015-06-30 | 2015-06-30 13:46:17 | 1 | Bus |
| 177 | 2015-06-30 | 2015-06-30 13:47:11 | 1 | Bus |
| 178 | 2015-06-30 | 2015-06-30 13:47:01 | 1 | Bus |
| 179 | 2015-06-30 | 2015-06-30 13:46:29 | 1 | Bus |
| 180 | 2015-06-30 | 2015-06-30 13:47:21 | 1 | Bus |
| 181 | 2015-06-30 | 2015-06-30 13:46:37 | 1 | Bus |
| 183 | 2015-06-30 | 2015-06-30 13:47:11 | 1 | Bus |
| 184 | 2015-06-30 | 2015-06-30 13:48:24 | 1 | Bus |
| 185 | 2015-06-30 | 2015-06-30 13:48:37 | 1 | Bus |
| 187 | 2015-06-30 | 2015-06-30 13:48:11 | 1 | Bus |
| 188 | 2015-06-30 | 2015-06-30 13:48:49 | 1 | Bus |
| 189 | 2015-06-30 | 2015-06-30 13:49:46 | 1 | Bus |
| 190 | 2015-06-30 | 2015-06-30 13:47:53 | 1 | Bus |
| 191 | 2015-06-30 | 2015-06-30 13:47:09 | 1 | Bus |
| 192 | 2015-06-30 | 2015-06-30 13:49:55 | 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;