You are here: Re: Error message on using union statement with order by using reserved words « MsSQL Server « IT news, forums, messages
Re: Error message on using union statement with order by using reserved words

Posted by signon77 on 10/30/07 16:44

Hi Roy,

Thanks for your help with this. My code now works looking like this:


SELECT
rr.BookName,
rr.ExternalId, -- Deal
rr.D1MTM, -- MTM on d-1
rr.PoolMTM, -- Pool MTM
abs(rr.[Difference]), -- Difference
rr.Comments -- Comments
FROM
#RevReps rr
UNION SELECT
d.BookName,
d.ExternalId, -- Deal
d.D1MTM, -- MTM on d-1
d.PoolMTM, -- Pool MTM
abs(d.[Difference]), -- Difference
d.Comments -- Comments
FROM
#RevRepDeals d
ORDER BY ExternalId desc, BookName asc, abs([Difference]) desc


Thanks again!!

Robert Ilechuku

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация