ArticleNumber Company Storage 01-01227 12 2 01-01227 2 1 'filtered by company/storage in combination 01-01227 5 1 01-01227 12 1 'filtered by company/storage in combination 01-44444 5 4 'filtered by not match the articlenumber
I want to filter lines containing ( company = 12 and storage = 1 ) and ( company = 2 and storage = 1 ) will be filtered from the result set, and also filtered on articlenr .
Is this what I came up with, but sure there should be an easier way to make this request?
SELECT * FROM MyTable where (Company=2 and Storage<>1 and ArticleNumber='01-01227') or (Company=12 and Storage<>1 and ArticleNumber='01-01227') or (Company<>2 and Company<>12 and ArticleNumber='01-01227')
The result that I get after:
ArticleNumber Company Storage 01-01227 12 2 01-01227 5 1
source share