What is the best format for this select condtion?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ucu13
    New Member
    • May 2012
    • 14

    What is the best format for this select condtion?

    i have a 'Like' condition in Sql Server Select query

    My condition is this:
    Code:
    WHERE IntestazioneCompleta LIKE '%D'AZEGLIO%'
    if i have a simple word like 'AZEGLIO' all works fine

    but with this type of word 'D'AZEGLIO'

    how i can format this in sql to make it work with this type of words?
    thanks in advance..
  • ucu13
    New Member
    • May 2012
    • 14

    #2
    solved!!!
    Code:
    WHERE IntestazioneCompleta LIKE '%D%AZEGLIO%'
    in php i used this code:
    Code:
    $string=D'AZEGLIO;
    Code:
    $string= preg_replace('/(\w)\'(\w)/', '$1%$2', $string);

    Comment

    Working...