From: | "David Johnston" <polobo(at)yahoo(dot)com> |
---|---|
To: | "'akp geek'" <akpgeek(at)gmail(dot)com>, "'pgsql-general'" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: find column name that has under score (_) |
Date: | 2011-02-17 19:07:53 |
Message-ID: | 049401cbced5$fa929f20$efb7dd60$@yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Try just using the string function "position". You'll need to check the
documentation or wait for others to determine which specific system views
you will need to obtain the column name (if you do not already know that
part).
position(substring in string) int
Non-Zero (or maybe >= 0) indicates the substring was found - though I would
test with some known sample data just to make sure before running it on the
column names.
Dave
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of akp geek
Sent: Thursday, February 17, 2011 1:56 PM
To: pgsql-general
Subject: [GENERAL] find column name that has under score (_)
Hi all -
I am trying to write a query to find all the column names in
database that has a underscore in it (_) example souce_id. I know like will
not work , if where column_name like '%_%' Can you please help?
Regards
From | Date | Subject | |
---|---|---|---|
Next Message | David Kerr | 2011-02-17 19:09:09 | Re: find column name that has under score (_) |
Previous Message | akp geek | 2011-02-17 19:07:25 | Re: find column name that has under score (_) |