CREATE VIEW ofb_17 AS 

SELECT 

// Insert constant columns here 
expver@desc as expver, 
class@desc as class, 
stream@desc as stream, 
type@desc as type, 
andate@desc as andate, 
antime@desc as antime, 
reportype@hdr as reportype, 
numtsl@desc, 
mxup_traj@desc,

// Insert hdr-aligned columns here 
date@hdr, 
rdbdate@hdr, 
lsm@modsurf, 
restricted@hdr, 
timeslot@timeslot_index, 
seqno@hdr, 
reportno@hdr, 
bufrtype@hdr, 
subtype@hdr, 
groupid@hdr, 
obstype@hdr, 
codetype@hdr, 
sensor@hdr, 
statid@hdr, 
time@hdr, 
rdbtime@hdr, 
report_status@hdr, 
report_event1@hdr, 
report_rdbflag@hdr, 
degrees(lat@hdr) as lat@hdr, 
degrees(lon@hdr) as lon@hdr, 
orography@modsurf, 
stalt@hdr, 
sonde_type@conv, 
station_type@conv, 
flight_phase@conv, 
aircraft_type@conv, 
heading@conv, 

// Insert body-aligned columns here 
entryno@body, 
vertco_reference_1@body, 
vertco_reference_2@body,
obsvalue@body, 
varno@body, 
vertco_type@body, 
ppcode@conv_body, 
level@conv_body, 
datum_anflag@body, 
datum_status@body, 
datum_event1@body, 
datum_rdbflag@body, 
biascorr@body, 
biascorr_fg@body, 
qc_pge@body, 
an_depar@body, 
fg_depar@body, 
obs_error@errstat, 
final_obs_error@errstat, 
fg_error@errstat, 
eda_spread@errstat, 
hires@update_2,
datum_status_hires@update_1, 
fc_sens_obs@body,
an_sens_obs@body,
an_depar@surfbody_feedback, 
fg_depar@surfbody_feedback, 
snow_depth@surfbody_feedback, 
snow_density@surfbody_feedback, 
datum_status@surfbody_feedback, 
datum_sfc_event@surfbody_feedback, 
lsm@surfbody_feedback,

// Keep these at the end
wigosid_1@hdr,
wigosid_2@hdr,
wigosid_3@hdr,
wigosid_4@hdr,

WHERE groupid@hdr == 17 ;
