On Thu, Aug 11, 2011 at 12:48, Edward W. Rouse <ero...@comsquared.com>wrote:
> How about SELECT cat_name, sum(amount) AS "amount" FROM category, > trans_details WHERE category_cat_id in (select cat_id from category where > lineage ~ ‘^1’)**** > > ** ** > > Where the in clause is basically, the cat_id where lineage starts with, and > then the lineage you want. 1, 1-2, whatever the lineage is. Not sure about > efficiency or whether you can put another subselect in there to build the > lineage string to match, but the basic idea should work. **** > > ** ** > > * > * > Thanks all, I will try out the suggestions. Samuel, thanks for the link! Haven't had a chance to check it out yet, but it sure looks promising. I'll post again when I've had a chance to look over/ try out some of these things. :-) Don -- D.C. Parris, FMP, LEED AP O+M, ESL Certificate Minister, Security/FM Coordinator, Free Software Advocate https://www.xing.com/profile/Don_Parris | http://www.linkedin.com/in/dcparris GPG Key ID: F5E179BE