Background: I am writing a query to compare actual and ideal growth data for children. Kids see doc once a year, doc measures, points get laid over typical growth curves. The problem is that the graphic component I use requires a fixed number of data points. No problem in having missing data as NULL, but they have to be there.
Data I've got:
age weight/kg
-----------------
2 10
3 11
6 20
Expected:
age weight/kg
-----------------
2 10
3 11
4 NULL
5 NULL
6 20
The required age values are fixed (2-6 in this example) and can be hard-coded, as they aren't in any table, otherwise I'd join and group. I would like to use a single query.