View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,401–5,425 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 5694 | 2018-05-05 | 2018-05-05 10:17:03 | 1 | Metro |
| 5695 | 2018-05-06 | 2018-05-06 09:57:41 | 1 | Private Vehicle |
| 5696 | 2018-05-06 | 2018-05-06 09:57:27 | 1 | Private Vehicle |
| 5697 | 2018-05-06 | 2018-05-06 09:42:59 | 1 | Metro |
| 5698 | 2018-05-06 | 2018-05-06 09:42:54 | 1 | Metro |
| 5699 | 2018-05-06 | 2018-05-06 09:43:37 | 1 | Metro |
| 5700 | 2018-05-06 | 2018-05-06 09:43:13 | 1 | Metro |
| 5701 | 2018-05-11 | 2018-05-11 15:56:54 | 1 | Metro |
| 5704 | 2018-05-08 | 2018-05-08 11:16:03 | 1 | Metro |
| 5705 | 2018-06-04 | 2018-06-04 11:52:00 | 1 | Taxi |
| 5706 | 2018-05-09 | 2018-05-09 13:48:51 | 2 | Metro |
| 5707 | 2018-08-27 | 2018-08-27 10:26:54 | 1 | Bus |
| 5708 | 2018-08-27 | 2018-08-27 10:27:01 | 1 | Bus |
| 5710 | 2018-08-27 | 2018-08-27 10:27:10 | 1 | Bus |
| 5711 | 2018-08-27 | 2018-08-27 10:27:39 | 1 | Bus |
| 5712 | 2018-08-27 | 2018-08-27 10:27:46 | 1 | Bus |
| 5713 | 2018-08-27 | 2018-08-27 10:27:34 | 1 | Bus |
| 5714 | 2018-08-27 | 2018-08-27 10:27:42 | 1 | Bus |
| 5715 | 2018-08-27 | 2018-08-27 10:28:18 | 1 | Bus |
| 5718 | 2018-08-27 | 2018-08-27 10:28:54 | 1 | Bus |
| 5719 | 2018-08-27 | 2018-08-27 10:29:00 | 1 | Bus |
| 5720 | 2018-08-27 | 2018-08-27 10:27:44 | 1 | Bus |
| 5722 | 2018-08-27 | 2018-08-27 10:29:39 | 1 | Bus |
| 5723 | 2018-08-27 | 2018-08-27 10:29:42 | 1 | Bus |
| 5727 | 2018-08-27 | 2018-08-27 10:28:25 | 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;