{"ok": true, "database": "scotrail", "query_name": "random_apology", "rows": [[1, "we apologise for the inconvenience caused by", "https://github.com/matteason/scotrail-announcements-june-2022/raw/main/announcements/1803.mp3"], [2, "ScotRail services to", "https://github.com/matteason/scotrail-announcements-june-2022/raw/main/announcements/0095.mp3"], [3, "Haydon Bridge ", "https://github.com/matteason/scotrail-announcements-june-2022/raw/main/announcements/1416.mp3"], [4, "has been cancelled", "https://github.com/matteason/scotrail-announcements-june-2022/raw/main/announcements/0340.mp3"], [5, "due to", "https://github.com/matteason/scotrail-announcements-june-2022/raw/main/announcements/1528.mp3"], [6, "A train hitting an obstruction on the line earlier on this train's journey", "https://github.com/matteason/scotrail-announcements-june-2022/raw/main/announcements/0929.mp3"]], "truncated": false, "columns": ["sort", "Transcription", "mp3"], "query": {"sql": "with apology as (\n select Transcription, mp3 from announcements where\n Category = 'Apology'\n order by random() limit 1\n),\ntrain_company as (\n select Transcription, mp3 from announcements where\n Category = 'Train operating company'\n and Transcription like '%to%'\n order by random() limit 1\n),\ndestination as (\n select Transcription, mp3 from announcements where\n Category = 'Destination'\n order by random() limit 1\n),\ncancelled as (\n select Transcription, mp3 from announcements where\n Transcription = 'has been cancelled'\n limit 1\n),\ndue_to as (\n select Transcription, mp3 from announcements where\n Transcription = 'due to'\n limit 1\n),\nreason as (\n select Transcription, mp3 from announcements where\n Category = 'Reason'\n order by random() limit 1\n),\ncombined as (\n select 1 as sort, * from apology\n union select 2, * from train_company\n union select 3, * from destination\n union select 4, * from cancelled\n union select 5, * from due_to\n union select 6, * from reason\n)\nselect * from combined order by sort", "params": {}}, "error": null, "private": false, "allow_execute_sql": true, "query_ms": 3.8247090000140815, "source": "matteason/scotrail-announcements-june-2022", "source_url": "https://github.com/matteason/scotrail-announcements-june-2022"}