Re: deleting an identical record - Mailing list pgsql-general

From missive@frontiernet.net (Lee Harr)
Subject Re: deleting an identical record
Date
Msg-id slrna7b8rm.9p.missive@whave.frontiernet.net
Whole thread Raw
In response to Re: deleting an identical record  (missive@frontiernet.net (Lee Harr))
List pgsql-general
>> create table t (a int, b text);
>>
>> insert into t values (1, 'a');
>> insert into t values (1, 'a');
>> insert into t values (1, 'a');
>> insert into t values (1, 'a');
>>
>> select oid, * from t;
>
> thanks, this works indeed, what's the meaning of the comma behind oid?
>


select
 a,
 b,
 sqrt(a::numeric),
 'a: '||a::text||' B: '||b::text as myfield
from
 t;


SELECT chooses fields from a table. When you select *, you choose all
fields (except for oid...). You can choose functions and operate
on fields too.

The ::type notation is to coerce the value in to the right type
for the particular function or operator.

So. The comma means "these are separate items in a list of fields."



pgsql-general by date:

Previous
From: missive@frontiernet.net (Lee Harr)
Date:
Subject: Re: Createdb problems
Next
From: Tom Lane
Date:
Subject: Re: PL/pgSQL Memory Management?