How to find Median Value then find all the values above that

  • Select InvoiceNumber, InvoiceTotal

    From Invoices

    WHERE InvoiceTotal >

    (Select InvoiceTotal

    From Invoices

    HAVING InvoiceTotal IN((COUNT(*) + 1) / 2, (COUNT(*) + 2) / 2))

    Group By InvoiceTotal

    Order By InvoiceTotal

    I am trying to fin all the Invoice Totals which are over the Median Value. I am having an issue writing this code and would greaty appreciate any help!:-)

  • If you would provide table definition, some sample data and required result based on the sample data, then some one will be able to assist you with a tested solution.

    Click on the first link in my signature block to read how to prepare the above in a short simple manner.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

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

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