none
IN operator to query SCCM database RRS feed

  • Question

  • Hello everybody,

    In fact, I have written a valid SQL statement to query the SCCM database, the system is not showing any syntax error however, the SQL statement do not return anything.

    When I write the equivalent using  "like"  and "OR" it shows me a result.

    The problem here is that I have multiple "OR"... :

    Like "... "

    OR

    Like "..."

    OR

    .....

    Long list to check!

    This will give bad performance. I wonder if there is a way to write something simple to verify all the my list names.

    I'm just asking if there's a reason why the IN operator is not working.

    Thanks in advance!

     

    • Changed type Naomi NModerator Thursday, April 26, 2012 4:08 PM Question rather than discussion
    Thursday, April 26, 2012 4:05 PM

Answers

  • Most likely you will need to search for a specific forum for SCCM for this question.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    • Marked as answer by KJian_ Thursday, May 3, 2012 6:06 AM
    Thursday, April 26, 2012 6:30 PM
    Moderator

All replies

  • Please post your exact query. Most likely you're running into a NULL problem, check this blog post

    Why you should never use IN/NOT IN in SQL

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    Thursday, April 26, 2012 4:10 PM
    Moderator
  • Hello Naomi!

    Thanks for your answer.

    I mean, I have to precise that I'm using SCCM to construct collections and IN is not working.

    I'm not using SQL Server.

    Somebody told me that it uses (WQL) vieW Query Language!

    Could we query a view using "IN" operator?

    Lot of questions, sorry!

    well, I will post the query as for tomorrow.

    Thanks again Naomi :)

    Samir


    samir

    Thursday, April 26, 2012 6:19 PM
  • Most likely you will need to search for a specific forum for SCCM for this question.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    • Marked as answer by KJian_ Thursday, May 3, 2012 6:06 AM
    Thursday, April 26, 2012 6:30 PM
    Moderator