View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,526–7,550 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7926 | 2019-04-04 | 2019-04-04 11:46:12 | 1 | Train |
| 7927 | 2019-04-04 | 2019-04-04 11:46:35 | 1 | Train |
| 7928 | 2019-04-04 | 2019-04-04 11:46:00 | 1 | Train |
| 7929 | 2019-04-04 | 2019-04-04 11:46:35 | 1 | Train |
| 7930 | 2019-04-03 | 2019-04-03 12:07:05 | 1 | Walk |
| 7931 | 2019-04-03 | 2019-04-03 12:06:26 | 1 | Walk |
| 7932 | 2019-07-14 | 2019-07-14 10:58:43 | 4 | Bus |
| 7933 | 2019-07-14 | 2019-07-14 10:58:52 | 4 | Bus |
| 7934 | 2019-07-14 | 2019-07-14 10:58:57 | 4 | Bus |
| 7935 | 2019-07-14 | 2019-07-14 10:58:55 | 4 | Bus |
| 7936 | 2019-07-14 | 2019-07-14 10:59:15 | 4 | Bus |
| 7937 | 2019-07-14 | 2019-07-14 10:59:23 | 4 | Bus |
| 7938 | 2019-07-14 | 2019-07-14 10:59:25 | 4 | Bus |
| 7939 | 2019-07-14 | 2019-07-14 11:00:28 | 4 | Bus |
| 7940 | 2019-07-14 | 2019-07-14 11:00:43 | 4 | Bus |
| 7941 | 2019-07-14 | 2019-07-14 10:59:28 | 4 | Bus |
| 7942 | 2019-07-14 | 2019-07-14 11:00:03 | 4 | Bus |
| 7943 | 2019-07-14 | 2019-07-14 10:59:38 | 4 | Bus |
| 7944 | 2019-07-14 | 2019-07-14 11:00:31 | 4 | Bus |
| 7945 | 2019-07-14 | 2019-07-14 10:59:48 | 4 | Bus |
| 7946 | 2019-07-14 | 2019-07-14 11:01:59 | 4 | Bus |
| 7947 | 2019-07-14 | 2019-07-14 11:01:58 | 4 | Bus |
| 7948 | 2019-07-14 | 2019-07-14 11:02:11 | 4 | Bus |
| 7949 | 2019-07-14 | 2019-07-14 10:59:51 | 4 | Bus |
| 7950 | 2019-07-14 | 2019-07-14 11:01:07 | 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;