Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Dynamically Build Order By

    how about Multiple columns

    such as

    declare @OrderBy varchar(200)

    set @OrderBy = 'FIRST_NAME,LAST_NAME'

    SELECT * FROM RESOURCE

    order by case @OrderBy

    WHEN 'FIRST_NAME,LAST_NAME' THEN FIRST_NAME,LAST_NAME

    WHEN 'LAST_NAME,FIRST_NAME' THEN LAST_NAME,FIRST_NAME

    END

    It will give you a...

Viewing post 1 (of 1 total)