Start with function

  • Use a CASE expression in the ORDER BY clause.

    DECLARE @Locations TABLE (

    LocationName varchar(10)

    )

    INSERT INTO @Locations VALUES('Africa')

    INSERT INTO @Locations VALUES('ASIA')

    INSERT INTO @Locations VALUES('America')

    INSERT INTO @Locations VALUES('Europa')

    SELECT *

    FROM @Locations

    ORDER BY CASE LocationName WHEN 'ASIA' THEN 0 ELSE 1 END, LocationName

    Hope this helps

    Gianluca

    -- Gianluca Sartori

  • Thnaks so much. It works .

    Regards

  • You're welcome.

    Glad I could help

    -- Gianluca Sartori

Viewing 3 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply