0

I know this is going to be so simple but for the life of me I cannot figure it out. I am trying to pull denial codes in my query that are either 35 or 48. The thing that is holding me up is a lot of these products have multiple denial codes and can contain my denial code but the results are only bringing back the products with the exact 35 or 48 code. For example product one might have denial 10,35,93. My query is not returning this line, instead its only returning those with 35 only. Thank you in advance.

SELECT * 
FROM PRODUCT_DENIAL_DETAILS
WHERE SOLD_DATE > SYSDATE -90
AND DENIALCD IN ('35','48')
1
  • Please show your table schema, and sample rows. Commented Nov 17, 2014 at 19:15

1 Answer 1

1

Then you have to use a wildcard in your condition.

 AND (DENIALCD LIKE '%35%' OR DENIAL CODE LIKE '%48%')

This will bring back any rows with the 35 or 48 in the field.

Sign up to request clarification or add additional context in comments.

2 Comments

Ahh I just knew it was going to be something simple! Thank you so much :)
Although, I would suggest that you rethink the design of the relations in your database and maybe just keep a single code per row which makes your querying etc a little better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.