Results 1 to 4 of 4
  1. #1
    Join Date
    May 2014
    Posts
    3

    Unanswered: using group by and Order by clause

    I have a a grid (Fig-1) where i have LineID and corresponding RankValue. I want to sort out the Grid like (Fig-2) where It will be sorted based on RankValue(Higher to lower) but LineID group should maintain. Please help. I am using SqlServer 2008.
    Attached Thumbnails Attached Thumbnails Untitled.jpg  

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Describe in more detail what you want to appear. What happens when there are multiple RankValues for a single LineID (use largest, smallest, other)? What if there is no RankValue for a LineID?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    May 2014
    Posts
    3
    Hi Thanks for the reply. There will be only one RankValue against LineID and other will be NULL. Based on the highest RankValue it will sort the grid but same time it will maintain LineID group.
    I want my Grid to be like Fig-2 where based on Highest RankValue grid is sorting and LineId group is maintaining.

  4. #4
    Join Date
    May 2014
    Posts
    3
    Hi Thanks for the reply. There will be only one RankValue against LineID and other will be NULL. Based on the highest RankValue it will sort the grid but same time it will maintain LineID group.
    I want my Grid to be like Fig-2 where based on Highest RankValue grid is sorting and LineId group is maintaining.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •