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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Need Help w/ Complex Query Statement

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-04-26 : 11:32:22
Cedric writes "This is a doozy!!!!!


Here's my Code:

Select Business_Name From HBC_Warehouse.dbo.HBC_Boiler_Temp_Contact Where
Type = 'OWNR' and Import_ID = 37


This should be the result of my data:
Business_Name
--------------------
Lincoln Co Brd of Ed

When I change the WHERE clause from AND to OR it will give me the USER business_name as well when all I want is the Type = 'OWNR'

This is the result I get when I change the WHERE clause to OR:
Business_Name
--------------------
Lincoln Co Brd of Ed
Stanford Elem"

drymchaser
Aged Yak Warrior

552 Posts

Posted - 2004-04-26 : 12:04:11
What does this give?

Select Business_Name, Type, Import_ID
from hbc_warehouse.cbo.hbc_boiler_temp_contact
where business_name in ('Lincoln Co Brd of Ed', 'Stanford Elem')
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-04-26 : 12:07:55
Or this?




I'm guessing 2.



Brett

8-)
Go to Top of Page
   

- Advertisement -