Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
angelaHLP
Starting Member
2 Posts |
Posted - 2011-01-28 : 13:58:43
|
| Hi all,I'm not really new to SQL Server, but I have this issue every one in awhile for some time. I've created a query, but when I run it in SQL Server 2003 Enterprise Manager it rearranges it into a query that is not what I want. If anyone can explain this to me I would be eternally grateful. This is the query I start with:SELECT *FROM Orders O INNER JOIN ShoppingCarts SC ON SC.shoppingcartid = O.fk_shoppingcartidWHERE O.cartname = 1 AND( O.name IS NULL OR (O.type IS NULL AND O.option LIKE 'No%') )When run it converts the query to:SELECT *FROM Orders O INNER JOIN ShoppingCarts SC ON SC.shoppingcartid = O.fk_shoppingcartidWHERE (O.name IS NULL) AND (O.cartname = 1) OR (O.type IS NULL) AND (O.option LIKE 'No%') AND (O.carname = 1)This is obviously not what I want. Thanks for any response!Angela |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
angelaHLP
Starting Member
2 Posts |
Posted - 2011-01-28 : 14:41:02
|
| tkizer,Thanks for the quick reply. The thing is that I'm running the query in ColdFusion and it is rearranging it when running there the same as in SQL Enterprise Manager. So that is why I was using it in the example. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|