brain freeze

  • I have two tables. One table with header information and one with detail. On the header record, there is sum total that should match the sum of the detail records. I need to write a query to make sure those totals match on separate tables. Thanks! 

  • select hdr.unqkey, sum(dtl.amt), hdr.hdr_amt_field

    from hdr join dtl on

    hdr.unqkey = dtl.unqkey

    group by hdr.unqkey, hdr.hdr_amt_field

    having sum(dtl.amt) hdr_amt_field



    Michelle

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply