Re: [GENERAL] Question about pattern matching

2008-12-23 Thread Dimitris Sakellarios
Thanks depesz, It was really helpful Dimitris. -Original Message- From: dep...@depesz.com [mailto:dep...@depesz.com] Sent: Tuesday, December 23, 2008 9:18 PM To: dimitris.sakellar...@telesuite.gr Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Question about pattern matching On

Re: [GENERAL] Question about pattern matching

2008-12-23 Thread dimitris . sakellarios
Jef thanks alot for your help. I appreciate that! It worked fine. Dimitris Quoting "Hoover, Jeffrey" : cameradb_dev=# select id, Candidate_pattern from all_patterns where :pattern like Candidate_pattern||'%' and candidate_pattern between substring(:pattern from 1 for 1) and

Re: [GENERAL] Question about pattern matching

2008-12-23 Thread dimitris . sakellarios
thanks alot for your help. Dimitris Quoting Grzegorz Jaƛkiewicz : SELECT ... from . WHERE X LIKE pattern || '%' ORDER BY length(pattern) DESC LIMIT 1; ??? basic prefix matching for telcos :P -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

[GENERAL] Question about pattern matching

2008-12-23 Thread dimitris . sakellarios
TABLENAME id Candidate pattern - 1 0089258068520 2 008925806852 3 00892580685 4 0089258068 5 008925806 6 00892580 7 0089258 8 008925 9 00892 10 0089 11 008 12 00 13 0 PATTERN --- 008925700