Solved

SQL 2008 SELECT

Posted on 2013-06-05
3
350 Views
Last Modified: 2013-06-05
Hello,
Can you please help,
I'm trying to do a simple select.

SELECT * FROM ScanItem where scanin is Null   (I get proper results - all data )
SELECT * FROM ScanItem where scanin is Null  and CCDriverNumber is NULL (I get proper results)

When I add another AND, I get no results. (i SHOULD GET FEW HUNDERED)
SELECT * FROM ScanItem where scanin is Null  and CCDriverNumber is NULL AND CCDriverNumber <> 2529

What am I missing?

thanks
0
Comment
Question by:Wass_QA
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
santoshmotwani earned 250 total points
ID: 39224376
SELECT * FROM ScanItem where scanin is Null  and CCDriverNumber is NULL
union all
SELECT * FROM ScanItem  where ccdriverNumber <> 2529

or

SELECT * FROM ScanItem where scanin is Null
and
((ccdriverNumber <> 2529) or (ccdriverNumber is null))
0
 

Author Comment

by:Wass_QA
ID: 39224383
This did it, thanks
0
 

Author Closing Comment

by:Wass_QA
ID: 39224385
Thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now