Consulting

Results 1 to 5 of 5

Thread: Solved: sql qurey to arrange by months

  1. #1
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location

    Arrow Solved: sql qurey to arrange by months

    i have month table with data type varchar
    month1
    January
    march
    December
    February
    October
    September
    may
    march

    i want sql query to arrange month according to month list(jan,feb,march,april)

  2. #2
    VBAX Tutor Mavyak's Avatar
    Joined
    Jul 2008
    Posts
    204
    Location
    ORDER BY
    CASE MONTH_FIELD
    WHEN 'JANUARY' THEN '1'
    WHEN 'FEBRUARY' THEN '2'
    ...
    ...
    ...
    END

  3. #3
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location
    PERFECT ,IF I USE ORDERBY COMMAND I CAN'T USE DISTINCT ANY SUGGESTION ON THIS

  4. #4
    VBAX Tutor Mavyak's Avatar
    Joined
    Jul 2008
    Posts
    204
    Location
    Use GROUP BY instead.

  5. #5
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location
    thanks for solving the problem

Posting Permissions

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