Re: deleting an identical record

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: deleting an identical record
Date: 2002-02-22 01:50:45
Message-ID: slrna7b8rm.9p.missive@whave.frontiernet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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."

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rip 2002-02-22 01:53:49 metadata and views
Previous Message Medi Montaseri 2002-02-22 01:31:44 Re: A Replication Idea