Forum Replies Created

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

  • Reply To: Need Help to write a query

    Got it Thanks.

     

    DECLARE @query_string as NVARCHAR(MAX),

    @cols as NVARCHAR(MAX)

    with data

    as (

    select top 21 (row_number() over(order by (select null))-1)*0.5 as rnk

    from master..spt_values

    )

    ,cols_data

    as(

    select ',count(case when abs(a.col_a)>='+cast(rnk as varchar(10)) +' then 1 end) +...

  • Reply To: Need Help to write a query

    Yes the result is correct. Can we make the column more dynamic? For now we need till 10, tomorrow if we need till 20 we may have to write 20...

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