Yet another good reason to maintain a calendar table.
My preferred alternative for creating a bed census from inpatient episodes.
A method to find the most recent activity for a patient.
Ways to summarise clinical coding information at episode level.
Searching for episodes coded with a particular diagnosis or procedure code is a bread-and-butter task for NHS information analysts.
Like most people, I’m quick to turn to Google when I need to know something, and Google searches for SQL-related questions throw up plenty of results from sites like StackOverflow.
However, many companies produce database software, and many of these products are queried using a language called “SQL”. But it turns out that each product has its own dialect. Keywords that work in one product may not work in another - and so the answer you find may not work in your database.