This worked.
Thank you all!
I know the casting is quite basic operation but could this be added to
the CREATE VIEW documentation? Now there is only an example:
CREATE VIEW vista AS SELECT text 'Hello World' AS hello;
The same syntax won't work with other type as Tom wrote.
-Lauri
On Wed, Oct 5,
Lauri Kajan writes:
> This works with other values but not with nulls:
> CREATE VIEW view1 AS
> SELECT
> attribute1 as a1,
> text null as a2,
> text 'test' as a3
> FROM
> table;
FYI, the syntax typename 'literal' works *only* with string literals,
not anything else. For any other targ
On Wed, Oct 05, 2011 at 05:22:21PM +0300, Lauri Kajan wrote:
> Hi all,
>
> How could I create a view that returns null values among all other values.
> Here is a sample that i want to achieve:
>
> CREATE VIEW view1 AS
> SELECT
> attribute1 as a1,
> null as a2
> FROM
> table;
>
> Now the pr
try:
CREATE OR REPLACE VIEW view1 AS
SELECT
name as a1,
null::text as a2,
'test'::text as a3
FROM
some_table;
Στις Wednesday 05 October 2011 17:22:21 ο/η Lauri Kajan έγραψε:
> Hi all,
>
> How could I create a view that returns null values among all other values.
> Here is a sample that i
Hi all,
How could I create a view that returns null values among all other values.
Here is a sample that i want to achieve:
CREATE VIEW view1 AS
SELECT
attribute1 as a1,
null as a2
FROM
table;
Now the problem is that I got an warning: column "a2" has type "unknown"
I know that I should de