Simple like filter

From: Ruzsinszky Attila <ruzsinszky(dot)attila(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Simple like filter
Date: 2009-08-27 10:39:13
Message-ID: f637dd860908270339m2310c57dgf1c73135b9d3f801@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

My data are look like:
1_123456
11_123456
111_123456
1111_123456
11111_123456 (varchar(20))

I would like a where like SQL command.
I tried this: like E'11\_%' -> wrong!
like E'11\_______' -> good (with 7 piece of _ characters!)

What would I have to do if the second part of the numbers (after the
_ character) will be different lenght?

TIA,
Ruzsi

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bob McConnell 2009-08-27 11:06:00 Re: how can I finish my suscription?
Previous Message Jignesh Shah 2009-08-27 10:22:17 Create generic Function definition in Perl