x

NULL Value

When i am running a SP i am getting an output multiple times for a particular Id. Ex Below: Customer ProductCategory SPARE_PART sRevisionLevel sPartNumber IBIBlockID sEquipmentNumber Amazon.com Electrical, Software & Controls NULL R00 23147900 2979799 3788039 (CP01) Amazon.com Electrical, Software & Controls Y R00 23147900 2979799 3788039 (CP01)

From the above example we can see that the SPARE_PART Column is having 2 values..One is Y and Other is NULL. So instead of getting 2 output rows i need only one output with SPARE_PART as Y and ignore NULL

more ▼

asked Sep 26 at 06:57 AM in Default

avatar image

prince1988
11 2

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Add the following to the WHERE clause

AND SPARE_PART IS NOT NULL

more ▼

answered Sep 26 at 09:40 AM

avatar image

anthony.green
3k 1 4 6

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x2188
x2031
x1154

asked: Sep 26 at 06:57 AM

Seen: 21 times

Last Updated: Sep 26 at 09:40 AM

Copyright 2017 Redgate Software. Privacy Policy