in reply to Re^3: (OT) Why SQL Sucks (with a little Perl to fix it)
in thread (OT) Why SQL Sucks (with a little Perl to fix it)

The canonical answer is to use a view on the accounts_receivable table. The problem is that your accounts_receivable table is too normalized for adequate performance. You have to create a denormalized view in order to get what you're looking for.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re^4: (OT) Why SQL Sucks (with a little Perl to fix it)

Replies are listed 'Best First'.
Re^5: (OT) Why SQL Sucks (with a little Perl to fix it)
by tilly (Archbishop) on Dec 15, 2005 at 03:14 UTC
    Yes, I know how to do it conceptually in pure SQL. I also know how to do it reasonably quickly using Oracle's analytic extensions. I prefer the latter solution since it runs at an acceptable speed without having a DBA get involved in changing the schema.