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

12 Comments

i can’t believe that either. :-)

i ph33r your db wrangling skillz.

Anonymous

I sent an e-mail to FutureMe! It should arrive in a year. Cool idea. :o)

Melanie

haha, Anonymous. Sorry, that was just me, forgetting to put my name in.

Dude. Seriously. Step AWAY from the database, and nobody gets hurt. PUT DOWN THE MYSQL! PUT IT DOWN….

Not like I’m one to talk. Sitting at home, friday night, editting my freaking paper. Freaking paper!

so i’m “writing my paper this weekend”. i’ve been sitting down at work reading about hepatitis C. i’m not sure why. i’ve looked over some master’s papers in the database online, so i’ve got a rough idea of what i’m up against. but my head’s not exactly in the game yet. c’mon justin… intro, background, design, implementation, next steps. 12345. easy.

Jackie

Your life is hell. 100% cotton paper? seriously? I like my paper from TREES, thanks…

i think that means i have to print it out on a tshirt

I wish I could work on my freaking paper, this 184 midterm is KILLING ME!!!!

i remember that. it took me 17 pages and the better part of a week to complete.

i swear to god, i am pulling sentences out of my head with pliers. my mind is rebeling at this whole process.

17 pages on Gogan’s midterm? You frighten me.

i really enjoyed that class, i guess i was leaving nothing to chance. who knows maybe he’s shortened it (this was 3 years ago)

Care to Comment?

Or if you'd prefer to get in touch privately, please send me an email.

Name

Email (optional)

Blog (optional)