View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 1–25 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 1 | 2015-03-15 | 2015-03-15 13:41:30 | 4 | Taxi |
| 2 | 2015-03-15 | 2015-03-15 13:40:50 | 4 | Taxi |
| 3 | 2015-03-04 | 2015-03-04 16:16:24 | 5 | Bus |
| 4 | 2015-03-04 | 2015-03-04 16:16:11 | 5 | Bus |
| 5 | 2015-03-03 | 2015-03-03 10:30:24 | 4 | Metro |
| 6 | 2015-03-03 | 2015-03-03 10:30:27 | 4 | Metro |
| 7 | 2015-03-08 | 2015-03-08 14:25:27 | 3 | Metro |
| 8 | 2015-04-25 | 2015-04-25 10:43:29 | 4 | Bus |
| 9 | 2015-04-25 | 2015-04-25 10:43:34 | 4 | Bus |
| 10 | 2015-04-25 | 2015-04-25 10:43:45 | 4 | Bus |
| 11 | 2015-04-25 | 2015-04-25 10:44:02 | 4 | Bus |
| 12 | 2015-04-25 | 2015-04-25 10:44:29 | 4 | Bus |
| 13 | 2015-04-25 | 2015-04-25 10:44:29 | 4 | Bus |
| 14 | 2015-04-25 | 2015-04-25 10:44:17 | 4 | Bus |
| 15 | 2015-04-25 | 2015-04-25 10:44:18 | 4 | Bus |
| 16 | 2015-04-25 | 2015-04-25 10:45:21 | 4 | Bus |
| 17 | 2015-04-25 | 2015-04-25 10:44:41 | 4 | Bus |
| 18 | 2015-04-25 | 2015-04-25 10:44:09 | 4 | Bus |
| 19 | 2015-04-25 | 2015-04-25 10:45:19 | 4 | Bus |
| 20 | 2015-04-25 | 2015-04-25 10:44:53 | 4 | Bus |
| 21 | 2015-04-25 | 2015-04-25 10:46:31 | 4 | Bus |
| 22 | 2015-04-25 | 2015-04-25 10:45:35 | 4 | Bus |
| 23 | 2015-04-25 | 2015-04-25 10:45:29 | 4 | Bus |
| 24 | 2015-04-25 | 2015-04-25 10:45:05 | 4 | Bus |
| 25 | 2015-04-25 | 2015-04-25 10:47:27 | 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;