dbTalk Databases Forums  

Re: [NOVICE] create table from regular expressions applied to rowsof multiple tables

mailing.database.pgsql-novice mailing.database.pgsql-novice


Discuss Re: [NOVICE] create table from regular expressions applied to rowsof multiple tables in the mailing.database.pgsql-novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff Davis
 
Posts: n/a

Default Re: [NOVICE] create table from regular expressions applied to rowsof multiple tables - 06-15-2012 , 06:36 PM






On Thu, 2012-06-14 at 23:22 +0100, e-letter wrote:
Quote:
Readers,

Tables contains text:

table1
text1, 10
text2, 20
text3, 30
text4, 40

table2
text2, textB 20
text3, textC 30
text5, textD 50
text6, textE 60
text7, textF 70
text8, textG 80

Is it possible to create a new table (table3) using a regular
expression (e.g. ^text*) to select rows which are of the same table
format as table2:

table3
text2, textB 20
text3, textC 30
I'm not sure I understand exactly what you're asking. Your example
table3 could also be produced by a simple inner join:

SELECT table1.col1, table2.col2
FROM table1, table2
WHERE table1.col1 = table2.col1;

But postgresql also offers a lot of regular expression functions, too.
See:

http://www.postgresql.org/docs/9.2/s...ns-string.html
http://www.postgresql.org/docs/9.2/s...-matching.html

Or post a more detailed example to show what you are looking for.

Regards,
Jeff Davis


--
Sent via pgsql-novice mailing list (pgsql-novice (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.