How i select % data using like

  • Here is my problem .

    create table test (

    val varchar (100)

    )

    insert into test values ('faheem')

    insert into test values ('faheem%')

    insert into test values ('king%faheem')

    select * from test

    Now i need data as

    VAL

    --------------

    faheem%

    king%faheem

    using Like operator how i do this ,Thanks

    Best Regards
    Faheem latif
    Senior Database Architect
    Genie Technologies (Pvt.) Ltd.

  • select * from test

    where charindex('%',val) > 0

  • select * From test where val like '%[%]%'

    "Keep Trying"

  • Thanks 2nd solution is working .

    TC Faheem

    Best Regards
    Faheem latif
    Senior Database Architect
    Genie Technologies (Pvt.) Ltd.

  • Hi

    select * from #test where val like '%/%%' ESCAPE '/'

    Refer this link, if you want more clarification

    http://msdn.microsoft.com/en-us/library/ms187489.aspx

    Thanks

    jaypee.s

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply