View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 8,351–8,375 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 8770 | 2019-08-18 | 2019-08-18 10:36:25 | 1 | Private Vehicle |
| 8771 | 2019-08-18 | 2019-08-18 10:36:12 | 1 | Private Vehicle |
| 8772 | 2019-08-18 | 2019-08-18 10:36:26 | 1 | Private Vehicle |
| 8773 | 2019-08-18 | 2019-08-18 10:36:55 | 1 | Private Vehicle |
| 8774 | 2019-08-28 | 2019-08-28 16:34:54 | 2 | Private Vehicle |
| 8775 | 2019-08-28 | 2019-08-28 16:34:42 | 2 | Private Vehicle |
| 8776 | 2019-08-21 | 2019-08-21 11:28:45 | 4 | Private Vehicle |
| 8778 | 2019-08-22 | 2019-08-22 16:40:51 | 4 | Train |
| 8779 | 2019-08-18 | 2019-08-18 14:02:32 | 1 | Private Vehicle |
| 8780 | 2019-08-18 | 2019-08-18 11:24:49 | 2 | Bus |
| 8781 | 2019-08-24 | 2019-08-24 15:19:05 | 3 | Train |
| 8782 | 2019-08-24 | 2019-08-24 15:19:07 | 3 | Train |
| 8783 | 2019-08-19 | 2019-08-19 10:43:59 | 2 | Other |
| 8784 | 2019-08-19 | 2019-08-19 13:07:23 | 2 | Metro |
| 8785 | 2019-08-19 | 2019-08-19 13:07:00 | 2 | Metro |
| 8786 | 2019-08-25 | 2019-08-25 14:27:44 | 1 | Metro |
| 8787 | 2019-08-25 | 2019-08-25 14:28:15 | 1 | Metro |
| 8788 | 2019-08-29 | 2019-08-29 10:46:18 | 4 | Metro |
| 8789 | 2019-08-29 | 2019-08-29 10:46:02 | 4 | Metro |
| 8790 | 2019-09-03 | 2019-09-03 09:30:08 | 1 | Train |
| 8791 | 2019-09-03 | 2019-09-03 09:30:11 | 1 | Train |
| 8792 | 2019-08-24 | 2019-08-24 14:47:24 | 2 | Train |
| 8793 | 2019-08-22 | 2019-08-22 14:41:39 | 1 | Walk |
| 8794 | 2019-08-22 | 2019-08-22 14:41:05 | 1 | Walk |
| 8795 | 2019-09-01 | 2019-09-01 10:41:59 | 1 | Walk |
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;