list non alphanumeric

From: "Baboo, Isa" <IBaboo(at)fnb(dot)co(dot)za>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: list non alphanumeric
Date: 2013-04-12 06:23:47
Message-ID: EEF91A759041DC4FBB3103789098746C0B3A4C69@FRGR1D1MX04.services.firstrand.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

Firstly let me mention I am a noob to postgres,DB and sql anyway, I have a column with First names and need to list names that have non-alphanumeric characters in them like + or * and the list goes on. I did google a bit and tried:
select * from TABLE where first_name not like '%[a-z0-9]%';

However the above shows all the entries in that column and if I change it to Like, which should show all the entries it shows nothing.

e.g of my goal:

Column
Bob
Jane+
Harry*
John
Mike
Larry

My query should output

Jane+
Harry*

To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser:
https://www.fnb.co.za/disclaimer.html

If you are unable to access the Disclaimer, send a blank e-mail to
firstrandbankdisclaimer(at)fnb(dot)co(dot)za and we will send you a copy of the Disclaimer.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2013-04-12 06:40:31 Re: list non alphanumeric
Previous Message Yuriy Rusinov 2013-04-12 06:05:13 GSL in mcbc(redhat)