View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,451–6,475 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6780 | 2018-10-18 | 2018-10-18 15:49:38 | 3 | Bus |
| 6781 | 2018-10-02 | 2018-10-02 14:41:54 | 2 | Private Vehicle |
| 6782 | 2018-10-02 | 2018-10-02 14:42:23 | 2 | Private Vehicle |
| 6783 | 2018-09-30 | 2018-09-30 10:41:12 | 3 | Metro |
| 6784 | 2018-10-03 | 2018-10-03 15:53:07 | 2 | Private Vehicle |
| 6785 | 2018-10-03 | 2018-10-03 15:53:27 | 2 | Private Vehicle |
| 6786 | 2018-10-03 | 2018-10-03 15:53:28 | 2 | Private Vehicle |
| 6787 | 2018-10-03 | 2018-10-03 15:53:12 | 2 | Private Vehicle |
| 6788 | 2018-10-10 | 2018-10-10 16:41:54 | 2 | Metro |
| 6789 | 2018-10-10 | 2018-10-10 16:41:55 | 2 | Metro |
| 6790 | 2018-12-09 | 2018-12-09 12:35:59 | 1 | Bus |
| 6791 | 2018-12-09 | 2018-12-09 12:36:12 | 1 | Bus |
| 6793 | 2018-12-09 | 2018-12-09 12:36:15 | 1 | Bus |
| 6794 | 2018-12-09 | 2018-12-09 12:36:41 | 1 | Bus |
| 6795 | 2018-12-09 | 2018-12-09 12:36:15 | 1 | Bus |
| 6797 | 2018-12-09 | 2018-12-09 12:36:34 | 1 | Bus |
| 6798 | 2018-12-09 | 2018-12-09 12:37:17 | 1 | Bus |
| 6800 | 2018-12-09 | 2018-12-09 12:36:27 | 1 | Bus |
| 6801 | 2018-12-09 | 2018-12-09 12:37:59 | 1 | Bus |
| 6802 | 2018-12-09 | 2018-12-09 12:37:20 | 1 | Bus |
| 6803 | 2018-12-09 | 2018-12-09 12:36:39 | 1 | Bus |
| 6804 | 2018-12-09 | 2018-12-09 12:36:54 | 1 | Bus |
| 6806 | 2018-12-09 | 2018-12-09 12:37:59 | 1 | Bus |
| 6807 | 2018-12-09 | 2018-12-09 12:39:01 | 1 | Bus |
| 6808 | 2018-12-09 | 2018-12-09 12:36:55 | 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;