Replicate Excel Quartile Function in Sql Server 2008 R2

Posted on 2011-04-29
Last Modified: 2012-05-11
Hi, does anyone know if there's a way to replicate Excel's Quartile Function in SQL Server 2008? Thanks.
Question by:Shino_skay
    LVL 51

    Accepted Solution

    maybe you can use nTile(4)

    select *, nTile(4) over (order by some_column) qTile
    from mytable

    Author Closing Comment

    there is a long complicated sql replication for the excel's quartile function to be mimiced in sql server

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now