View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 326–350 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 350 | 2015-05-12 | 2015-05-12 10:58:43 | 1 | Other |
| 351 | 2015-05-12 | 2015-05-12 10:59:14 | 1 | Other |
| 352 | 2015-05-12 | 2015-05-12 10:58:46 | 1 | Other |
| 353 | 2015-05-12 | 2015-05-12 10:59:06 | 1 | Other |
| 354 | 2015-04-30 | 2015-04-30 16:12:05 | 1 | Other |
| 355 | 2015-04-30 | 2015-04-30 16:11:36 | 1 | Other |
| 356 | 2015-05-01 | 2015-05-01 11:46:00 | 2 | Walk |
| 357 | 2015-05-01 | 2015-05-01 11:46:15 | 2 | Walk |
| 358 | 2015-05-01 | 2015-05-01 10:12:29 | 1 | Train |
| 359 | 2015-05-01 | 2015-05-01 10:12:23 | 1 | Train |
| 360 | 2015-05-01 | 2015-05-01 10:12:06 | 1 | Train |
| 361 | 2015-08-02 | 2015-08-02 11:53:12 | 4 | Bus |
| 362 | 2015-08-02 | 2015-08-02 11:53:16 | 4 | Bus |
| 363 | 2015-08-02 | 2015-08-02 11:53:20 | 4 | Bus |
| 364 | 2015-08-02 | 2015-08-02 11:53:42 | 4 | Bus |
| 365 | 2015-08-02 | 2015-08-02 11:53:52 | 4 | Bus |
| 366 | 2015-08-02 | 2015-08-02 11:54:07 | 4 | Bus |
| 367 | 2015-08-02 | 2015-08-02 11:54:30 | 4 | Bus |
| 368 | 2015-08-02 | 2015-08-02 11:54:08 | 4 | Bus |
| 369 | 2015-08-02 | 2015-08-02 11:54:24 | 4 | Bus |
| 370 | 2015-08-02 | 2015-08-02 11:55:27 | 4 | Bus |
| 371 | 2015-08-02 | 2015-08-02 11:55:42 | 4 | Bus |
| 373 | 2015-08-02 | 2015-08-02 11:54:51 | 4 | Bus |
| 374 | 2015-08-02 | 2015-08-02 11:54:48 | 4 | Bus |
| 375 | 2015-08-02 | 2015-08-02 11:55:35 | 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;