|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, August 19, 2009 3:01 AM
Points: 3,
Visits: 2
|
|
In select query values with space appended takes higher precedence than normal characters . How to overcome this . I.e the result is like this as shown below but i want 1001 to come on the top. Since i am using union all cannot use order by. Cost Evaluation Sheet Decision Gate 1 Complete Involvement Complete Statement of Work 1001
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 12:01 PM
Points: 2,677,
Visits: 2,273
|
|
Why can't you use ORDER BY?
try this
declare @items1 table (item varchar(100)) declare @items2 table (item varchar(100)) insert into @items1 select 'Cost Evaluation Sheet' union select 'Decision Gate 1 Complete' union select 'Involvement Complete' union select 'Statement of Work' insert into @items2 select 1001 select item from @items1 union all select item from @items2 order by item
returns
1001 Cost Evaluation Sheet Decision Gate 1 Complete Involvement Complete Statement of Work
|
|
|
|