i can’t believe i write this stuff like it’s no big thing
for the non-sql-acquainted: there’s nothing to see here, move along, move along…
this is an actual query (hand-generated) from my financial-database-cum-master’s-project:
SELECT o.obligation_id, o.project_year_id, o.obligation_amount, o2.obligation_amount as allocable_amount, o.obligation_modification_number, o.obligation_notes, f.fund_id, f.objective_id, ft.fund_type_code, ft.fund_type_name, obj.objective_code, obj.objective_name, r.region_code, r.region_name, e.earmark_code, e.earmark_name, p.project_year_id, p.project_year_code FROM obligation o LEFT JOIN obligation o2 ON o2.parent_obligation_id = o.obligation_id LEFT JOIN project_year p ON o.project_year_id = p.project_year_id LEFT JOIN fund f ON o.fund_id=f.fund_id LEFT JOIN fund_type ft ON f.fund_type_id = ft.fund_type_id LEFT JOIN objective obj ON f.objective_id = obj.objective_id LEFT JOIN region r ON f.region_id = r.region_id LEFT JOIN earmark e ON f.earmark_id = e.earmark_id WHERE ft.fund_type_id <> 4 ORDER BY o.project_year_id, ft.fund_type_id, obj.objective_id, r.region_name, o.obligation_amount


i can’t believe that either. :-)
i ph33r your db wrangling skillz.