View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,051–7,075 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7412 | 2019-02-19 | 2019-02-19 09:39:01 | 1 | Bus |
| 7413 | 2019-02-19 | 2019-02-19 09:40:01 | 1 | Bus |
| 7414 | 2019-02-19 | 2019-02-19 09:36:55 | 1 | Bus |
| 7415 | 2019-02-19 | 2019-02-19 09:36:35 | 1 | Bus |
| 7416 | 2019-02-19 | 2019-02-19 09:39:22 | 1 | Bus |
| 7417 | 2019-02-19 | 2019-02-19 09:40:29 | 1 | Bus |
| 7418 | 2019-02-19 | 2019-02-19 09:36:21 | 1 | Bus |
| 7419 | 2019-02-19 | 2019-02-19 09:40:55 | 1 | Bus |
| 7420 | 2019-02-19 | 2019-02-19 09:40:06 | 1 | Bus |
| 7421 | 2019-02-19 | 2019-02-19 09:40:49 | 1 | Bus |
| 7422 | 2019-02-19 | 2019-02-19 09:41:01 | 1 | Bus |
| 7423 | 2019-02-19 | 2019-02-19 09:37:15 | 1 | Bus |
| 7424 | 2019-02-19 | 2019-02-19 09:36:45 | 1 | Bus |
| 7425 | 2019-02-19 | 2019-02-19 09:38:37 | 1 | Bus |
| 7426 | 2019-02-19 | 2019-02-19 09:38:07 | 1 | Bus |
| 7427 | 2019-02-19 | 2019-02-19 09:43:55 | 1 | Bus |
| 7428 | 2019-02-19 | 2019-02-19 09:37:40 | 1 | Bus |
| 7429 | 2019-02-19 | 2019-02-19 09:41:05 | 1 | Bus |
| 7430 | 2019-02-19 | 2019-02-19 09:38:31 | 1 | Bus |
| 7431 | 2019-02-19 | 2019-02-19 09:37:55 | 1 | Bus |
| 7432 | 2019-02-19 | 2019-02-19 09:39:26 | 1 | Bus |
| 7433 | 2019-02-19 | 2019-02-19 09:40:17 | 1 | Bus |
| 7434 | 2019-02-19 | 2019-02-19 09:44:55 | 1 | Bus |
| 7435 | 2019-02-19 | 2019-02-19 09:45:09 | 1 | Bus |
| 7436 | 2019-02-19 | 2019-02-19 09:39:54 | 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;