Re: Cast on character columns in views

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: "Luiz K(dot) Matsumura" <luiz(at)planit(dot)com(dot)br>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Cast on character columns in views
Date: 2007-09-04 04:23:59
Message-ID: 144384.86744.qm@web31802.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--- "Luiz K. Matsumura" <luiz(at)planit(dot)com(dot)br> wrote:
> CREATE VIEW view1( id, col1, type1, type2) AS
> SELECT table1.id,
> table1.col1,
> CAST( table2.type1 AS CHARACTER( 3 )),
> NULL
> FROM table1
> JOIN table2 ON table2.fk_table1 = table1.id
> UNION ALL
> SELECT table1.id,
> table1.col1,
> CAST( NULL AS CHARACTER( 3 )),
> table3.type2
> FROM table1
> JOIN table3 ON table3.fk_table1 = table1.id;

Would the above changes work?

Regards,
Richard Broersma Jr.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitry Turin 2007-09-04 04:25:15 Re: Request into several DBMS simultaneously on DDL and DML
Previous Message chester c young 2007-09-04 04:08:37 Re: Execute SQL statements with 'context'/predefined variables