This creates a super simple temp table, inserts some values, and selects them. The oddity here is that it orders the '-' first. This despite fact that the '+' character has an ASCII value of 43 and '-' has an ASCII value of 45. Even weirder than this is if you replace the nchar(1) with a char(1) declaration it returns the result set ordered in reverse, correctly prioritizing the '+' character over the '-'.
CREATE TABLE #ORDERTEST ( OPER nchar(1), ORDINAL INT ) INSERT INTO #ORDERTEST VALUES('+', 1) INSERT INTO #ORDERTEST VALUES('-', 2) INSERT INTO #ORDERTEST VALUES('+', 3) SELECT * FROM #ORDERTEST ORDER BY OPER DROP TABLE #ORDERTEST
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
An Experts Exchange subscription includes unlimited access to online courses.Get Started
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE