View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,201–6,225 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6525 | 2018-10-05 | 2018-10-05 11:42:54 | 4 | Bus |
| 6526 | 2018-10-05 | 2018-10-05 11:43:56 | 4 | Bus |
| 6527 | 2018-10-05 | 2018-10-05 11:43:30 | 4 | Bus |
| 6528 | 2018-10-05 | 2018-10-05 11:44:15 | 4 | Bus |
| 6529 | 2018-10-05 | 2018-10-05 11:44:18 | 4 | Bus |
| 6530 | 2018-10-05 | 2018-10-05 11:44:19 | 4 | Bus |
| 6531 | 2018-10-05 | 2018-10-05 11:43:42 | 4 | Bus |
| 6532 | 2018-10-05 | 2018-10-05 11:43:49 | 4 | Bus |
| 6533 | 2018-10-05 | 2018-10-05 11:43:28 | 4 | Bus |
| 6534 | 2018-10-05 | 2018-10-05 11:45:48 | 4 | Bus |
| 6535 | 2018-10-05 | 2018-10-05 11:43:38 | 4 | Bus |
| 6536 | 2018-10-05 | 2018-10-05 11:44:00 | 4 | Bus |
| 6538 | 2018-10-05 | 2018-10-05 11:45:18 | 4 | Bus |
| 6540 | 2018-10-05 | 2018-10-05 11:45:28 | 4 | Bus |
| 6541 | 2018-10-05 | 2018-10-05 11:43:58 | 4 | Bus |
| 6542 | 2018-10-05 | 2018-10-05 11:45:27 | 4 | Bus |
| 6543 | 2018-10-05 | 2018-10-05 11:44:08 | 4 | Bus |
| 6544 | 2018-10-05 | 2018-10-05 11:45:22 | 4 | Bus |
| 6545 | 2018-10-05 | 2018-10-05 11:45:06 | 4 | Bus |
| 6546 | 2018-10-05 | 2018-10-05 11:43:58 | 4 | Bus |
| 6547 | 2018-10-05 | 2018-10-05 11:45:20 | 4 | Bus |
| 6548 | 2018-10-05 | 2018-10-05 11:44:33 | 4 | Bus |
| 6549 | 2018-10-05 | 2018-10-05 11:47:26 | 4 | Bus |
| 6550 | 2018-10-05 | 2018-10-05 11:46:10 | 4 | Bus |
| 6551 | 2018-10-05 | 2018-10-05 11:44:18 | 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;