By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

What is the best format for this select condtion?

P: 14
i have a 'Like' condition in Sql Server Select query

My condition is this:
Expand|Select|Wrap|Line Numbers
  1. 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..
Oct 10 '12 #1

✓ answered by ucu13

solved!!!
Expand|Select|Wrap|Line Numbers
  1. WHERE IntestazioneCompleta LIKE '%D%AZEGLIO%'
in php i used this code:
Expand|Select|Wrap|Line Numbers
  1. $string=D'AZEGLIO;
Expand|Select|Wrap|Line Numbers
  1. $string= preg_replace('/(\w)\'(\w)/', '$1%$2', $string);

Share this Question
Share on Google+
1 Reply


P: 14
solved!!!
Expand|Select|Wrap|Line Numbers
  1. WHERE IntestazioneCompleta LIKE '%D%AZEGLIO%'
in php i used this code:
Expand|Select|Wrap|Line Numbers
  1. $string=D'AZEGLIO;
Expand|Select|Wrap|Line Numbers
  1. $string= preg_replace('/(\w)\'(\w)/', '$1%$2', $string);
Oct 10 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.