craigscott
Programmer
Hello,
I have the following SQL Table
CREATE TABLE [dbo].[country_lookup] (
[country_id] [int] IDENTITY (1, 1) NOT NULL ,
[country_code] [varchar] (50) NULL ,
[country_name] [varchar] (50) NULL ,
[country_dialcode] [varchar] (50) NULL
) ON [PRIMARY]
I am trying to write a single query to order the results set so I can get a particular country_id First, then the rest ordered after it.
Something along the lines of:-
SELECT * FROM country_lookup ORDER BY country_id = 289, country_name
With no luck,
Any Ideas on a solution, situation requires not to use a Stored Procedure.
Cheers
Craig
I have the following SQL Table
CREATE TABLE [dbo].[country_lookup] (
[country_id] [int] IDENTITY (1, 1) NOT NULL ,
[country_code] [varchar] (50) NULL ,
[country_name] [varchar] (50) NULL ,
[country_dialcode] [varchar] (50) NULL
) ON [PRIMARY]
I am trying to write a single query to order the results set so I can get a particular country_id First, then the rest ordered after it.
Something along the lines of:-
SELECT * FROM country_lookup ORDER BY country_id = 289, country_name
With no luck,
Any Ideas on a solution, situation requires not to use a Stored Procedure.
Cheers
Craig