View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 1,051–1,075 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 1120 | 2015-10-13 | 2015-10-13 13:25:26 | 4 | Bus |
| 1121 | 2015-10-13 | 2015-10-13 13:21:11 | 4 | Bus |
| 1122 | 2015-10-13 | 2015-10-13 13:21:17 | 4 | Bus |
| 1123 | 2015-10-13 | 2015-10-13 13:26:11 | 4 | Bus |
| 1124 | 2015-10-13 | 2015-10-13 13:20:56 | 4 | Bus |
| 1125 | 2015-10-13 | 2015-10-13 13:22:43 | 4 | Bus |
| 1126 | 2015-09-27 | 2015-09-27 14:58:00 | 5 | Bus |
| 1127 | 2015-09-27 | 2015-09-27 14:58:31 | 5 | Bus |
| 1128 | 2015-09-18 | 2015-09-18 10:39:42 | 1 | Walk |
| 1129 | 2015-09-18 | 2015-09-18 10:39:18 | 1 | Walk |
| 1130 | 2015-09-19 | 2015-09-19 11:01:07 | 2 | Train |
| 1131 | 2015-09-19 | 2015-09-19 11:01:10 | 2 | Train |
| 1132 | 2015-09-16 | 2015-09-16 11:38:47 | 1 | Metro |
| 1133 | 2015-09-16 | 2015-09-16 11:39:08 | 1 | Metro |
| 1134 | 2015-11-10 | 2015-11-10 09:46:30 | 4 | Other |
| 1135 | 2015-11-10 | 2015-11-10 09:46:40 | 4 | Other |
| 1136 | 2015-11-10 | 2015-11-10 09:46:44 | 4 | Other |
| 1137 | 2015-11-10 | 2015-11-10 09:47:03 | 4 | Other |
| 1139 | 2015-11-10 | 2015-11-10 09:46:50 | 4 | Other |
| 1140 | 2015-11-10 | 2015-11-10 09:47:35 | 4 | Other |
| 1141 | 2015-11-10 | 2015-11-10 09:46:54 | 4 | Other |
| 1142 | 2015-11-10 | 2015-11-10 09:46:58 | 4 | Other |
| 1143 | 2015-11-10 | 2015-11-10 09:47:42 | 4 | Other |
| 1144 | 2015-11-10 | 2015-11-10 09:47:24 | 4 | Other |
| 1145 | 2015-11-10 | 2015-11-10 09:48:50 | 4 | Other |
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;