Skip to content
Advertisement

how to filter data in sql

I am trying to filter the data according to several criteria, and based on these criteria, the record record number 7 (M08) should not appear because the “NewSiteID” column is not null and does not belong to the number 6, but the problem is that this record appears even though I used the conditions that appear in the query.

Advertisement

Answer

You need to use parenthesis around your conditions. In this case it can also be simplified quite a bit. If I understand what you are trying to do it could be something like this.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement