View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 8,526–8,550 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 8957 | 2019-09-11 | 2019-09-11 10:40:19 | 2 | Metro |
| 8958 | 2019-09-11 | 2019-09-11 10:40:20 | 2 | Metro |
| 8959 | 2019-12-15 | 2019-12-15 11:05:02 | 4 | Bus |
| 8960 | 2019-12-15 | 2019-12-15 11:05:12 | 4 | Bus |
| 8961 | 2019-12-15 | 2019-12-15 11:05:22 | 4 | Bus |
| 8962 | 2019-12-15 | 2019-12-15 11:05:32 | 4 | Bus |
| 8963 | 2019-12-15 | 2019-12-15 11:05:30 | 4 | Bus |
| 8964 | 2019-12-15 | 2019-12-15 11:06:12 | 4 | Bus |
| 8965 | 2019-12-15 | 2019-12-15 11:06:08 | 4 | Bus |
| 8966 | 2019-12-15 | 2019-12-15 11:05:37 | 4 | Bus |
| 8967 | 2019-12-15 | 2019-12-15 11:07:02 | 4 | Bus |
| 8968 | 2019-12-15 | 2019-12-15 11:06:59 | 4 | Bus |
| 8969 | 2019-12-15 | 2019-12-15 11:05:42 | 4 | Bus |
| 8970 | 2019-12-15 | 2019-12-15 11:06:52 | 4 | Bus |
| 8971 | 2019-12-15 | 2019-12-15 11:07:38 | 4 | Bus |
| 8972 | 2019-12-15 | 2019-12-15 11:07:38 | 4 | Bus |
| 8973 | 2019-12-15 | 2019-12-15 11:07:08 | 4 | Bus |
| 8974 | 2019-12-15 | 2019-12-15 11:08:17 | 4 | Bus |
| 8975 | 2019-12-15 | 2019-12-15 11:06:54 | 4 | Bus |
| 8976 | 2019-12-15 | 2019-12-15 11:08:26 | 4 | Bus |
| 8977 | 2019-12-15 | 2019-12-15 11:08:20 | 4 | Bus |
| 8978 | 2019-12-15 | 2019-12-15 11:07:15 | 4 | Bus |
| 8979 | 2019-12-15 | 2019-12-15 11:08:02 | 4 | Bus |
| 8980 | 2019-12-15 | 2019-12-15 11:09:35 | 4 | Bus |
| 8981 | 2019-12-15 | 2019-12-15 11:10:10 | 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;