question

prince1988 avatar image
prince1988 asked

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
sql-server-2008sql-server-2005sql
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
anthony.green avatar image
anthony.green answered
Add the following to the WHERE clause AND SPARE_PART IS NOT NULL
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.