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

is there a function which elminates spaces?

P: n/a
In a WHERE clause, I want to to compare strings ignoring the spaces
inside them. Is therd a function to do that? I do not find it in the
documentation.

SELECT ... WHERE (ignore_spaces(table.phone_number) ~* igore_spaces(?));

would be fine but ignore_space() does not exist!
Maybe there is a solution based on regular epxression, but I do not see it.
Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Pierre Couderc" <pi****@couderc.ccNOSPAM> schreef in bericht
news:dj***********@biggoron.nerim.net...
In a WHERE clause, I want to to compare strings ignoring the spaces
inside them. Is therd a function to do that? I do not find it in the
documentation.

SELECT ... WHERE (ignore_spaces(table.phone_number) ~* igore_spaces(?));

would be fine but ignore_space() does not exist!

Try translating [only] space(s) to .. nothing:
SELECT ... WHERE translate(table.phone_number,' ','') = translate(?,' ','');

be aware this will never use an index!

HansH
Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.