View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,126–5,150 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 5405 | 2018-05-07 | 2018-05-07 11:57:43 | 4 | Bus |
| 5406 | 2018-05-07 | 2018-05-07 11:55:56 | 4 | Bus |
| 5407 | 2018-05-07 | 2018-05-07 11:57:31 | 4 | Bus |
| 5408 | 2018-05-07 | 2018-05-07 11:56:37 | 4 | Bus |
| 5409 | 2018-05-07 | 2018-05-07 12:00:27 | 4 | Bus |
| 5410 | 2018-05-07 | 2018-05-07 12:01:46 | 4 | Bus |
| 5411 | 2018-05-07 | 2018-05-07 11:56:21 | 4 | Bus |
| 5412 | 2018-05-07 | 2018-05-07 11:56:26 | 4 | Bus |
| 5413 | 2018-05-07 | 2018-05-07 11:56:31 | 4 | Bus |
| 5414 | 2018-05-07 | 2018-05-07 11:55:59 | 4 | Bus |
| 5415 | 2018-05-07 | 2018-05-07 11:56:41 | 4 | Bus |
| 5416 | 2018-05-07 | 2018-05-07 12:01:58 | 4 | Bus |
| 5417 | 2018-05-07 | 2018-05-07 12:01:31 | 4 | Bus |
| 5418 | 2018-05-07 | 2018-05-07 11:56:15 | 4 | Bus |
| 5419 | 2018-05-07 | 2018-05-07 11:57:43 | 4 | Bus |
| 5420 | 2018-05-07 | 2018-05-07 12:04:16 | 4 | Bus |
| 5421 | 2018-05-07 | 2018-05-07 12:00:07 | 4 | Bus |
| 5422 | 2018-05-07 | 2018-05-07 11:58:01 | 4 | Bus |
| 5423 | 2018-05-07 | 2018-05-07 11:56:35 | 4 | Bus |
| 5424 | 2018-05-07 | 2018-05-07 11:59:00 | 4 | Bus |
| 5425 | 2018-05-07 | 2018-05-07 12:04:43 | 4 | Bus |
| 5426 | 2018-05-07 | 2018-05-07 12:02:30 | 4 | Bus |
| 5427 | 2018-03-16 | 2018-03-16 12:22:50 | 1 | Bus |
| 5428 | 2018-03-16 | 2018-03-16 14:09:26 | 5 | Metro |
| 5429 | 2018-03-22 | 2018-03-22 09:05:57 | 1 | 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;