Calculate the average length of stay for each diagnosis for discharged cases (discharge_dateIS NOT NULL). Round the result to 0 decimal places and sort by diagnosis alphabetically.
Expected Output
Query Editor
User Output Ready
Execute a query or press Ctrl+Enter to view results...
Databases & Questions
Hint
In PostgreSQL, subtracting one date from another gives a number of days.