HOW TO USE LIKE CLAUSE? IS IT POSSIBLE TO USE IT WITH INT DATA TYPE VARIABLE?

Jonas Stuart

Total Post:27

Points:189
Posted by  Jonas Stuart
C# 
C#
 515  View(s)
Ratings:
Rate this:
Hi Buddy

How to use like clause? Is it possible to use it with INT data type variable?
Please explain me.I would really appreciate your help.

Thanks


  1. Abhishek Srivasatava

    Post:24

    Points:168
    Re: How to use like clause? Is it possible to use it with INT data type variable?

     Hi Jonas,

     

    Yes, it is possible to use like command with Integer data type verified in SQL server 2008 .


    SELECT *
    FROM Ee_empl_cat4
    where
    prsn_intn_id  LIKE '10%'




    Use of like statement with different Wildcard :


    
    

    SELECT DISTICT  A.PRSN_ADHAR_NUM

    FROM ADHAR

    WHERE NAME LIKE 'P%' -- this statement fetch all those record whose name is start with ‘P’.

    OR City LIKE '%A' -- this statement fetch all those record whose name is ends with ‘A’.

    OR City LIKE '%ank%'-- this statement fetch all those adhar number whose name contains ‘ank’ in between their number.

    OR City NOT LIKE 's%'

    OR City LIKE R_S_I_E_H -- this statement is used to find the city name start with R followed by any text, followed by ‘S’ followed by any text, followed by I followed by any text, followed by E followed by any text and string last letter will be H. Wildcard ( _ )  is like a substitution for any alphabet.

    OR  City  LIKE '[abc]' -- fetch all those city name which start with a,b,c.

    OR  City  LIKE '[a-c]' -- fetch all those city name which start with a,b,c.

     

      Modified On Sep-30-2016 12:44:47 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!