Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group