Re: [SQL] how can tell if a column is a primary key?

Поиск
Список
Период
Сортировка
От Gary MacMinn
Тема Re: [SQL] how can tell if a column is a primary key?
Дата
Msg-id s83034c6.078@syd_aux.nca.gov.au
обсуждение исходный текст
Ответы Re: [SQL] nulls and datetime  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
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
thedate() 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.




В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Verificate values in other table?
Следующее
От: "Gary MacMinn"
Дата:
Сообщение: [SQL] Handling NULL Dates