﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Development  / In select query values with space appended takes higher precedence than normal characters / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 00:19:50 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: In select query values with space appended takes higher precedence than normal characters</title><link>http://www.sqlservercentral.com/Forums/Topic773300-145-1.aspx</link><description>Why can't you use ORDER BY?try this[code]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 @items1union allselect item from @items2order by item[/code]returns[code]1001Cost Evaluation SheetDecision Gate 1 CompleteInvolvement CompleteStatement of Work[/code]</description><pubDate>Wed, 19 Aug 2009 03:37:13 GMT</pubDate><dc:creator>kevriley</dc:creator></item><item><title>In select query values with space appended takes higher precedence than normal characters</title><link>http://www.sqlservercentral.com/Forums/Topic773300-145-1.aspx</link><description>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 Work1001</description><pubDate>Wed, 19 Aug 2009 03:09:11 GMT</pubDate><dc:creator>nazmunnisa_g</dc:creator></item></channel></rss>