View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,276–2,300 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2411 | 2016-06-27 | 2016-06-27 12:05:57 | 2 | Private Vehicle |
| 2412 | 2016-06-27 | 2016-06-27 12:06:29 | 2 | Private Vehicle |
| 2413 | 2016-06-27 | 2016-06-27 12:06:34 | 2 | Private Vehicle |
| 2414 | 2016-06-27 | 2016-06-27 12:06:28 | 2 | Private Vehicle |
| 2415 | 2016-06-26 | 2016-06-26 12:02:31 | 2 | Bus |
| 2416 | 2016-06-26 | 2016-06-26 12:02:37 | 2 | Bus |
| 2417 | 2016-06-26 | 2016-06-26 12:02:46 | 2 | Bus |
| 2418 | 2016-06-26 | 2016-06-26 12:02:38 | 2 | Bus |
| 2419 | 2016-06-26 | 2016-06-26 12:03:00 | 2 | Bus |
| 2420 | 2016-07-08 | 2016-07-08 09:02:55 | 3 | Metro |
| 2421 | 2016-07-08 | 2016-07-08 09:03:00 | 3 | Metro |
| 2422 | 2016-07-08 | 2016-07-08 09:02:43 | 3 | Metro |
| 2423 | 2016-06-29 | 2016-06-29 13:14:35 | 3 | Taxi |
| 2424 | 2016-07-12 | 2016-07-12 09:03:07 | 2 | Walk |
| 2425 | 2016-07-12 | 2016-07-12 12:08:04 | 2 | Private Vehicle |
| 2426 | 2016-07-12 | 2016-07-12 12:08:33 | 2 | Private Vehicle |
| 2427 | 2016-07-12 | 2016-07-12 12:08:01 | 2 | Private Vehicle |
| 2428 | 2016-07-12 | 2016-07-12 12:08:01 | 2 | Private Vehicle |
| 2429 | 2016-06-30 | 2016-06-30 13:47:50 | 2 | Metro |
| 2430 | 2016-06-30 | 2016-06-30 13:47:35 | 2 | Metro |
| 2431 | 2016-06-30 | 2016-06-30 13:47:32 | 2 | Metro |
| 2432 | 2016-07-01 | 2016-07-01 12:04:59 | 1 | Bus |
| 2433 | 2016-07-01 | 2016-07-01 12:05:37 | 1 | Bus |
| 2434 | 2016-07-01 | 2016-07-01 12:05:40 | 1 | Bus |
| 2435 | 2016-07-01 | 2016-07-01 12:05:41 | 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;