Where clause with like and not like operators not working










0














I have this query:



SELECT 
DISTINCT
REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
ISNULL(A.[PLANO], '') AS PLANO ,
A.[Plano Foco] ,
CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
B.[FEAT_CAMERA] ,
B.[FEAT_TELA] ,
B.[FEAT_CAP_ARMAZENAMENTO] ,
B.[FEAT_PROCESSADOR] ,
B.[FEAT_MEMORIA_RAM] ,
B.[FEAT_BATERIA] ,
B.[EXTRA_INFO_1] ,
B.[EXTRA_INFO_2] ,
B.[EXTRA_INFO_3]
FROM [TABELA DE PRECOS] AS A
LEFT JOIN DE_PARA_SAP_APARELHOS AS B
ON (A.[NOME DPGC] = B.APARELHODPAV)
WHERE PLANO LIKE '%CONTROLE%'
AND PLANO NOT LIKE '%Renova%'
AND A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet')
AND REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
AND A.[REGIAO] = '7x'
ORDER BY PRECO,[PLANO]


I've searched a bit and found that if you have null values, LIKE and NOT LIKE could not work properly, so i'm using ISNULL. But i'm still getting values that contains 'Renova':



Novo Vivo V (Renova)
Novo Vivo V
Vivo Família 70GB (Renova)
Vivo Família 50GB (Renova)
Vivo Família 70GB
Vivo Controle....


I don't get any error messages. The query runs fine, but it's like my like and not like operators are being ignored or something like that. What am i missing here?










share|improve this question



















  • 2




    It's not the (NOT) LIKE. When you format your query (I did it for you) it's easier to spot that there's an ORed condition. AND has a higher precedence than OR, you probably don't want that --> add parens around the ORed condition. AND (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND A.[REGIAO] = '7x'. Btw, you should always use parens when you mix AND and OR
    – dnoeth
    Nov 12 at 15:19











  • @dnoeth dont know why you didnt make it an answer
    – Juan Carlos Oropeza
    Nov 12 at 15:24










  • LIKE and NOT LIKE could not work properly, so i'm using ISNULL ..... I dont see ISNULL anywhere
    – Juan Carlos Oropeza
    Nov 12 at 15:25















0














I have this query:



SELECT 
DISTINCT
REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
ISNULL(A.[PLANO], '') AS PLANO ,
A.[Plano Foco] ,
CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
B.[FEAT_CAMERA] ,
B.[FEAT_TELA] ,
B.[FEAT_CAP_ARMAZENAMENTO] ,
B.[FEAT_PROCESSADOR] ,
B.[FEAT_MEMORIA_RAM] ,
B.[FEAT_BATERIA] ,
B.[EXTRA_INFO_1] ,
B.[EXTRA_INFO_2] ,
B.[EXTRA_INFO_3]
FROM [TABELA DE PRECOS] AS A
LEFT JOIN DE_PARA_SAP_APARELHOS AS B
ON (A.[NOME DPGC] = B.APARELHODPAV)
WHERE PLANO LIKE '%CONTROLE%'
AND PLANO NOT LIKE '%Renova%'
AND A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet')
AND REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
AND A.[REGIAO] = '7x'
ORDER BY PRECO,[PLANO]


I've searched a bit and found that if you have null values, LIKE and NOT LIKE could not work properly, so i'm using ISNULL. But i'm still getting values that contains 'Renova':



Novo Vivo V (Renova)
Novo Vivo V
Vivo Família 70GB (Renova)
Vivo Família 50GB (Renova)
Vivo Família 70GB
Vivo Controle....


I don't get any error messages. The query runs fine, but it's like my like and not like operators are being ignored or something like that. What am i missing here?










share|improve this question



















  • 2




    It's not the (NOT) LIKE. When you format your query (I did it for you) it's easier to spot that there's an ORed condition. AND has a higher precedence than OR, you probably don't want that --> add parens around the ORed condition. AND (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND A.[REGIAO] = '7x'. Btw, you should always use parens when you mix AND and OR
    – dnoeth
    Nov 12 at 15:19











  • @dnoeth dont know why you didnt make it an answer
    – Juan Carlos Oropeza
    Nov 12 at 15:24










  • LIKE and NOT LIKE could not work properly, so i'm using ISNULL ..... I dont see ISNULL anywhere
    – Juan Carlos Oropeza
    Nov 12 at 15:25













0












0








0







I have this query:



SELECT 
DISTINCT
REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
ISNULL(A.[PLANO], '') AS PLANO ,
A.[Plano Foco] ,
CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
B.[FEAT_CAMERA] ,
B.[FEAT_TELA] ,
B.[FEAT_CAP_ARMAZENAMENTO] ,
B.[FEAT_PROCESSADOR] ,
B.[FEAT_MEMORIA_RAM] ,
B.[FEAT_BATERIA] ,
B.[EXTRA_INFO_1] ,
B.[EXTRA_INFO_2] ,
B.[EXTRA_INFO_3]
FROM [TABELA DE PRECOS] AS A
LEFT JOIN DE_PARA_SAP_APARELHOS AS B
ON (A.[NOME DPGC] = B.APARELHODPAV)
WHERE PLANO LIKE '%CONTROLE%'
AND PLANO NOT LIKE '%Renova%'
AND A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet')
AND REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
AND A.[REGIAO] = '7x'
ORDER BY PRECO,[PLANO]


I've searched a bit and found that if you have null values, LIKE and NOT LIKE could not work properly, so i'm using ISNULL. But i'm still getting values that contains 'Renova':



Novo Vivo V (Renova)
Novo Vivo V
Vivo Família 70GB (Renova)
Vivo Família 50GB (Renova)
Vivo Família 70GB
Vivo Controle....


I don't get any error messages. The query runs fine, but it's like my like and not like operators are being ignored or something like that. What am i missing here?










share|improve this question















I have this query:



SELECT 
DISTINCT
REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
ISNULL(A.[PLANO], '') AS PLANO ,
A.[Plano Foco] ,
CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
B.[FEAT_CAMERA] ,
B.[FEAT_TELA] ,
B.[FEAT_CAP_ARMAZENAMENTO] ,
B.[FEAT_PROCESSADOR] ,
B.[FEAT_MEMORIA_RAM] ,
B.[FEAT_BATERIA] ,
B.[EXTRA_INFO_1] ,
B.[EXTRA_INFO_2] ,
B.[EXTRA_INFO_3]
FROM [TABELA DE PRECOS] AS A
LEFT JOIN DE_PARA_SAP_APARELHOS AS B
ON (A.[NOME DPGC] = B.APARELHODPAV)
WHERE PLANO LIKE '%CONTROLE%'
AND PLANO NOT LIKE '%Renova%'
AND A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet')
AND REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB'
AND A.[REGIAO] = '7x'
ORDER BY PRECO,[PLANO]


I've searched a bit and found that if you have null values, LIKE and NOT LIKE could not work properly, so i'm using ISNULL. But i'm still getting values that contains 'Renova':



Novo Vivo V (Renova)
Novo Vivo V
Vivo Família 70GB (Renova)
Vivo Família 50GB (Renova)
Vivo Família 70GB
Vivo Controle....


I don't get any error messages. The query runs fine, but it's like my like and not like operators are being ignored or something like that. What am i missing here?







sql sql-server-2012






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 15:22









dnoeth

44.6k31838




44.6k31838










asked Nov 12 at 15:12









Joao Victor

47431127




47431127







  • 2




    It's not the (NOT) LIKE. When you format your query (I did it for you) it's easier to spot that there's an ORed condition. AND has a higher precedence than OR, you probably don't want that --> add parens around the ORed condition. AND (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND A.[REGIAO] = '7x'. Btw, you should always use parens when you mix AND and OR
    – dnoeth
    Nov 12 at 15:19











  • @dnoeth dont know why you didnt make it an answer
    – Juan Carlos Oropeza
    Nov 12 at 15:24










  • LIKE and NOT LIKE could not work properly, so i'm using ISNULL ..... I dont see ISNULL anywhere
    – Juan Carlos Oropeza
    Nov 12 at 15:25












  • 2




    It's not the (NOT) LIKE. When you format your query (I did it for you) it's easier to spot that there's an ORed condition. AND has a higher precedence than OR, you probably don't want that --> add parens around the ORed condition. AND (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND A.[REGIAO] = '7x'. Btw, you should always use parens when you mix AND and OR
    – dnoeth
    Nov 12 at 15:19











  • @dnoeth dont know why you didnt make it an answer
    – Juan Carlos Oropeza
    Nov 12 at 15:24










  • LIKE and NOT LIKE could not work properly, so i'm using ISNULL ..... I dont see ISNULL anywhere
    – Juan Carlos Oropeza
    Nov 12 at 15:25







2




2




It's not the (NOT) LIKE. When you format your query (I did it for you) it's easier to spot that there's an ORed condition. AND has a higher precedence than OR, you probably don't want that --> add parens around the ORed condition. AND (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND A.[REGIAO] = '7x'. Btw, you should always use parens when you mix AND and OR
– dnoeth
Nov 12 at 15:19





It's not the (NOT) LIKE. When you format your query (I did it for you) it's easier to spot that there's an ORed condition. AND has a higher precedence than OR, you probably don't want that --> add parens around the ORed condition. AND (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND A.[REGIAO] = '7x'. Btw, you should always use parens when you mix AND and OR
– dnoeth
Nov 12 at 15:19













@dnoeth dont know why you didnt make it an answer
– Juan Carlos Oropeza
Nov 12 at 15:24




@dnoeth dont know why you didnt make it an answer
– Juan Carlos Oropeza
Nov 12 at 15:24












LIKE and NOT LIKE could not work properly, so i'm using ISNULL ..... I dont see ISNULL anywhere
– Juan Carlos Oropeza
Nov 12 at 15:25




LIKE and NOT LIKE could not work properly, so i'm using ISNULL ..... I dont see ISNULL anywhere
– Juan Carlos Oropeza
Nov 12 at 15:25












2 Answers
2






active

oldest

votes


















0














brackets missing on OR clause:



SELECT DISTINCT REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
ISNULL(A.[PLANO], '') AS PLANO ,
A.[Plano Foco] ,
CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
B.[FEAT_CAMERA] ,
B.[FEAT_TELA] ,
B.[FEAT_CAP_ARMAZENAMENTO] ,
B.[FEAT_PROCESSADOR] ,
B.[FEAT_MEMORIA_RAM] ,
B.[FEAT_BATERIA] ,
B.[EXTRA_INFO_1] ,
B.[EXTRA_INFO_2] ,
B.[EXTRA_INFO_3]
FROM @A AS A
LEFT JOIN @B AS B ON
A.[NOME DPGC] = B.APARELHODPAV
WHERE PLANO LIKE '%CONTROLE%' AND
PLANO NOT LIKE '%Renova%' AND
A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet') AND
(REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND
A.[REGIAO] = '7x'
ORDER BY PRECO,[PLANO]





share|improve this answer




























    -1














    If you do not want to include Renova, do not include it in your where clause and it will be exempted from the selection. That will solve your problem.






    share|improve this answer




















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265026%2fwhere-clause-with-like-and-not-like-operators-not-working%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      brackets missing on OR clause:



      SELECT DISTINCT REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
      ISNULL(A.[PLANO], '') AS PLANO ,
      A.[Plano Foco] ,
      CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
      B.[FEAT_CAMERA] ,
      B.[FEAT_TELA] ,
      B.[FEAT_CAP_ARMAZENAMENTO] ,
      B.[FEAT_PROCESSADOR] ,
      B.[FEAT_MEMORIA_RAM] ,
      B.[FEAT_BATERIA] ,
      B.[EXTRA_INFO_1] ,
      B.[EXTRA_INFO_2] ,
      B.[EXTRA_INFO_3]
      FROM @A AS A
      LEFT JOIN @B AS B ON
      A.[NOME DPGC] = B.APARELHODPAV
      WHERE PLANO LIKE '%CONTROLE%' AND
      PLANO NOT LIKE '%Renova%' AND
      A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet') AND
      (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND
      A.[REGIAO] = '7x'
      ORDER BY PRECO,[PLANO]





      share|improve this answer

























        0














        brackets missing on OR clause:



        SELECT DISTINCT REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
        ISNULL(A.[PLANO], '') AS PLANO ,
        A.[Plano Foco] ,
        CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
        B.[FEAT_CAMERA] ,
        B.[FEAT_TELA] ,
        B.[FEAT_CAP_ARMAZENAMENTO] ,
        B.[FEAT_PROCESSADOR] ,
        B.[FEAT_MEMORIA_RAM] ,
        B.[FEAT_BATERIA] ,
        B.[EXTRA_INFO_1] ,
        B.[EXTRA_INFO_2] ,
        B.[EXTRA_INFO_3]
        FROM @A AS A
        LEFT JOIN @B AS B ON
        A.[NOME DPGC] = B.APARELHODPAV
        WHERE PLANO LIKE '%CONTROLE%' AND
        PLANO NOT LIKE '%Renova%' AND
        A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet') AND
        (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND
        A.[REGIAO] = '7x'
        ORDER BY PRECO,[PLANO]





        share|improve this answer























          0












          0








          0






          brackets missing on OR clause:



          SELECT DISTINCT REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
          ISNULL(A.[PLANO], '') AS PLANO ,
          A.[Plano Foco] ,
          CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
          B.[FEAT_CAMERA] ,
          B.[FEAT_TELA] ,
          B.[FEAT_CAP_ARMAZENAMENTO] ,
          B.[FEAT_PROCESSADOR] ,
          B.[FEAT_MEMORIA_RAM] ,
          B.[FEAT_BATERIA] ,
          B.[EXTRA_INFO_1] ,
          B.[EXTRA_INFO_2] ,
          B.[EXTRA_INFO_3]
          FROM @A AS A
          LEFT JOIN @B AS B ON
          A.[NOME DPGC] = B.APARELHODPAV
          WHERE PLANO LIKE '%CONTROLE%' AND
          PLANO NOT LIKE '%Renova%' AND
          A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet') AND
          (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND
          A.[REGIAO] = '7x'
          ORDER BY PRECO,[PLANO]





          share|improve this answer












          brackets missing on OR clause:



          SELECT DISTINCT REPLACE(REPLACE(A.[NOME COMERCIAL],'.',''),'&','') AS [NOME COMERCIAL] ,
          ISNULL(A.[PLANO], '') AS PLANO ,
          A.[Plano Foco] ,
          CONVERT(DECIMAL(18,2),A.[PRECO]) AS PRECO ,
          B.[FEAT_CAMERA] ,
          B.[FEAT_TELA] ,
          B.[FEAT_CAP_ARMAZENAMENTO] ,
          B.[FEAT_PROCESSADOR] ,
          B.[FEAT_MEMORIA_RAM] ,
          B.[FEAT_BATERIA] ,
          B.[EXTRA_INFO_1] ,
          B.[EXTRA_INFO_2] ,
          B.[EXTRA_INFO_3]
          FROM @A AS A
          LEFT JOIN @B AS B ON
          A.[NOME DPGC] = B.APARELHODPAV
          WHERE PLANO LIKE '%CONTROLE%' AND
          PLANO NOT LIKE '%Renova%' AND
          A.[PRODUTO] IN ('Smartphone', 'Blackbox 3G', 'Blackbox 4G', 'Fixo', 'Modem 3G', 'Modem 4G', 'Tablet') AND
          (REPLACE(REPLACE(REPLACE(A.[NOME DPGC],'&',''),'''',''),'.','') = 'Iphone XR 64GB' OR REPLACE(REPLACE(REPLACE(B.[APARELHODPAV],'&',''),'''',''),'.','') = 'Iphone XR 64GB') AND
          A.[REGIAO] = '7x'
          ORDER BY PRECO,[PLANO]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 at 15:26









          Marta B

          35118




          35118























              -1














              If you do not want to include Renova, do not include it in your where clause and it will be exempted from the selection. That will solve your problem.






              share|improve this answer

























                -1














                If you do not want to include Renova, do not include it in your where clause and it will be exempted from the selection. That will solve your problem.






                share|improve this answer























                  -1












                  -1








                  -1






                  If you do not want to include Renova, do not include it in your where clause and it will be exempted from the selection. That will solve your problem.






                  share|improve this answer












                  If you do not want to include Renova, do not include it in your where clause and it will be exempted from the selection. That will solve your problem.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 12 at 17:26









                  Ted

                  302




                  302



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265026%2fwhere-clause-with-like-and-not-like-operators-not-working%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      這個網誌中的熱門文章

                      Barbados

                      How to read a connectionString WITH PROVIDER in .NET Core?

                      Node.js Script on GitHub Pages or Amazon S3