View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 4,801–4,825 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 5057 | 2018-01-05 | 2018-01-05 11:57:35 | 1 | Other |
| 5058 | 2018-01-05 | 2018-01-05 11:57:34 | 1 | Other |
| 5059 | 2018-01-05 | 2018-01-05 11:57:34 | 1 | Other |
| 5060 | 2018-01-12 | 2018-01-12 10:16:28 | 1 | Walk |
| 5061 | 2018-01-22 | 2018-01-22 11:14:56 | 2 | Metro |
| 5062 | 2018-01-22 | 2018-01-22 11:14:47 | 2 | Metro |
| 5063 | 2018-01-22 | 2018-01-22 11:14:18 | 2 | Metro |
| 5064 | 2018-01-22 | 2018-01-22 11:15:01 | 2 | Metro |
| 5065 | 2018-01-13 | 2018-01-13 13:31:07 | 5 | Walk |
| 5066 | 2018-01-07 | 2018-01-07 11:01:31 | 2 | Train |
| 5067 | 2018-05-04 | 2018-05-04 12:17:58 | 4 | Bus |
| 5068 | 2018-05-04 | 2018-05-04 12:18:08 | 4 | Bus |
| 5069 | 2018-05-04 | 2018-05-04 12:18:14 | 4 | Bus |
| 5070 | 2018-05-04 | 2018-05-04 12:18:31 | 4 | Bus |
| 5073 | 2018-05-04 | 2018-05-04 12:18:30 | 4 | Bus |
| 5074 | 2018-05-04 | 2018-05-04 12:19:03 | 4 | Bus |
| 5075 | 2018-05-04 | 2018-05-04 12:18:22 | 4 | Bus |
| 5077 | 2018-05-04 | 2018-05-04 12:19:08 | 4 | Bus |
| 5078 | 2018-05-04 | 2018-05-04 12:19:02 | 4 | Bus |
| 5079 | 2018-05-04 | 2018-05-04 12:18:43 | 4 | Bus |
| 5080 | 2018-05-04 | 2018-05-04 12:18:58 | 4 | Bus |
| 5082 | 2018-05-04 | 2018-05-04 12:20:32 | 4 | Bus |
| 5083 | 2018-05-04 | 2018-05-04 12:20:10 | 4 | Bus |
| 5084 | 2018-05-04 | 2018-05-04 12:21:13 | 4 | Bus |
| 5085 | 2018-05-04 | 2018-05-04 12:20:46 | 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;