Hi.

I have strange problem with sql query results. I am joining two tables and displaing result with order by clause. But results on MS SQL and Sybase are different. After removing order by clause in both queries results are equal. I am using the same table so I do not know what is the source of this difference.

Maybe they use different collations? Resultset is ordered by the collation you use..

I think that collations are not used because order attribute is of type smallint

OK, I guess the orders are different(or joins), which one is the correct one select and which is not?

the queries I used in both cases are exactly the same and using the same database.

"After removing order by clause in both queries results are equal. I am using the same table so I do not know what is the source of this difference."
When you add ORDER BY which query sorts the resulset correctly (sybase or ms sql)?

ahh. ok :) I have resultset generated from Sybase query. I have rewritten existing code into T-SQL and results I get are not equal so I think that result from Sybase is correct.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.