Forum Replies Created

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

  • RE: need some NTILE magic

    sgmunson (12/12/2012)


    Well, I managed to find a working example, and perhaps you can tailor this to suit:

    declare @a table (a int null, b int null)

    insert

  • RE: need some NTILE magic

    sgmunson (12/12/2012)


    Ok, how about:

    select cr.sup, cr.part, cr.loc, cr.countrank, cr.days,

    NTILE(days) OVER (PARTITION by cr.days, LOC order by countrank desc) as partitionday

    from cc_v_countrank cr

    and if the results aren't quite right, try reversing...

  • RE: need some NTILE magic

    sgmunson (12/12/2012)


    Without table data to work with, I have no testing capacity, but I want to know what you get when you do something like this:

    select cr.sup, cr.part, cr.loc, cr.countrank,...

  • RE: need some NTILE magic

    sgmunson (12/12/2012)


    After looking at the Books Online entry for NTILE, it's expecting an "integer expression", and it does allow you to access fields that exist in the PARTITION BY expression,...

  • RE: openrowset and variables for querying AD help

    I should add that Im not stuck on openrow set but I cant seem to pass login credentials to openquery when using a linked server and thats why im trying...

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