View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,326–6,350 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6652 | 2018-12-24 | 2018-12-24 10:27:53 | 1 | Bus |
| 6653 | 2018-12-24 | 2018-12-24 10:28:32 | 1 | Bus |
| 6654 | 2018-12-24 | 2018-12-24 10:26:19 | 1 | Bus |
| 6655 | 2018-12-24 | 2018-12-24 10:29:56 | 1 | Bus |
| 6656 | 2018-12-24 | 2018-12-24 10:30:10 | 1 | Bus |
| 6657 | 2018-12-24 | 2018-12-24 10:27:12 | 1 | Bus |
| 6658 | 2018-12-24 | 2018-12-24 10:31:11 | 1 | Bus |
| 6659 | 2018-12-24 | 2018-12-24 10:28:02 | 1 | Bus |
| 6660 | 2018-12-24 | 2018-12-24 10:25:16 | 1 | Bus |
| 6661 | 2018-12-24 | 2018-12-24 10:30:44 | 1 | Bus |
| 6662 | 2018-12-24 | 2018-12-24 10:30:57 | 1 | Bus |
| 6663 | 2018-12-24 | 2018-12-24 10:29:54 | 1 | Bus |
| 6664 | 2018-12-24 | 2018-12-24 10:26:11 | 1 | Bus |
| 6665 | 2018-12-24 | 2018-12-24 10:25:36 | 1 | Bus |
| 6666 | 2018-12-24 | 2018-12-24 10:25:40 | 1 | Bus |
| 6667 | 2018-12-24 | 2018-12-24 10:30:38 | 1 | Bus |
| 6668 | 2018-12-24 | 2018-12-24 10:27:57 | 1 | Bus |
| 6669 | 2018-12-24 | 2018-12-24 10:26:36 | 1 | Bus |
| 6670 | 2018-12-24 | 2018-12-24 10:28:11 | 1 | Bus |
| 6671 | 2018-12-24 | 2018-12-24 10:27:32 | 1 | Bus |
| 6672 | 2018-12-24 | 2018-12-24 10:26:04 | 1 | Bus |
| 6673 | 2018-12-24 | 2018-12-24 10:29:20 | 1 | Bus |
| 6674 | 2018-12-24 | 2018-12-24 10:31:55 | 1 | Bus |
| 6675 | 2018-12-24 | 2018-12-24 10:32:56 | 1 | Bus |
| 6676 | 2018-12-24 | 2018-12-24 10:30:35 | 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;