View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,451–7,475 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7849 | 2019-04-15 | 2019-04-15 12:03:02 | 1 | Bus |
| 7850 | 2019-04-15 | 2019-04-15 12:03:52 | 1 | Bus |
| 7851 | 2019-04-15 | 2019-04-15 12:06:46 | 1 | Bus |
| 7852 | 2019-04-15 | 2019-04-15 12:06:09 | 1 | Bus |
| 7853 | 2019-04-15 | 2019-04-15 12:03:44 | 1 | Bus |
| 7854 | 2019-04-15 | 2019-04-15 12:03:49 | 1 | Bus |
| 7855 | 2019-04-15 | 2019-04-15 12:08:06 | 1 | Bus |
| 7856 | 2019-04-15 | 2019-04-15 12:04:57 | 1 | Bus |
| 7857 | 2019-04-15 | 2019-04-15 12:06:34 | 1 | Bus |
| 7858 | 2019-04-15 | 2019-04-15 12:06:44 | 1 | Bus |
| 7859 | 2019-04-15 | 2019-04-15 12:08:30 | 1 | Bus |
| 7860 | 2019-04-15 | 2019-04-15 12:07:37 | 1 | Bus |
| 7861 | 2019-04-15 | 2019-04-15 12:04:58 | 1 | Bus |
| 7862 | 2019-04-15 | 2019-04-15 12:10:19 | 1 | Bus |
| 7863 | 2019-04-15 | 2019-04-15 12:05:10 | 1 | Bus |
| 7864 | 2019-04-15 | 2019-04-15 12:05:16 | 1 | Bus |
| 7867 | 2019-04-15 | 2019-04-15 12:06:38 | 1 | Bus |
| 7868 | 2019-04-15 | 2019-04-15 12:07:25 | 1 | Bus |
| 7869 | 2019-04-15 | 2019-04-15 12:07:34 | 1 | Bus |
| 7870 | 2019-04-15 | 2019-04-15 12:07:43 | 1 | Bus |
| 7871 | 2019-04-15 | 2019-04-15 12:06:28 | 1 | Bus |
| 7872 | 2019-04-15 | 2019-04-15 12:08:44 | 1 | Bus |
| 7873 | 2019-04-15 | 2019-04-15 12:10:22 | 1 | Bus |
| 7874 | 2019-04-15 | 2019-04-15 12:11:19 | 1 | Bus |
| 7875 | 2019-03-20 | 2019-03-20 11:35:03 | 2 | Metro |
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;