pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary MacMinn <G.MacMinn@nca.gov.au>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] how can tell if a column is a primary key?
Date: Mon, 15 Nov 1999 16:28:19 +1100
Message-ID: <s83034c6.078@syd_aux.nca.gov.au> (raw)

Hello All,

I'm trying to find out if PostgreSQL has a function like NVL that replaces null values with a default?

I have a table with datetime fields, some of which are null. I'm trying to extract the date and time components with the date() and time() functions but the null values break these functions.

If NVL is not there, could anyone suggest alternatives?

TIA,
Gary MacMinn

================
Table    = test1
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| t1                               | text                             |   var |
| d1                               | datetime                         |     8 |
+----------------------------------+----------------------------------+-------+

Query : SELECT t1, date(d1) from test1;  //The date() function breaks if the d1 field is not set.





view thread (6+ messages)  latest in thread

Message-ID: <s83034c6.078@syd_aux.nca.gov.au>
Permalink:  ../s83034c6.078@syd_aux.nca.gov.au/
Also on:    postgresql.org/message-id/s83034c6.078@syd_aux.nca.gov.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: G.MacMinn@nca.gov.au
  Subject: Re: [SQL] how can tell if a column is a primary key?
  In-Reply-To: <s83034c6.078@syd_aux.nca.gov.au>
  References: <s83034c6.078@syd_aux.nca.gov.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox