Re: comparring dates between perl and postgres

Поиск
Список
Период
Сортировка
От Sai Hertz And Control Systems
Тема Re: comparring dates between perl and postgres
Дата
Msg-id 3FCE70AB.7070209@sancharnet.in
обсуждение исходный текст
Ответ на Re: comparring dates between perl and postgres  (hodges@xprt.net)
Список pgsql-novice
I have never used extract. This generates a syntax error when I added

>and select extract( DOY FROM date)
>
>    $sth = $dbh->prepare("SELECT date,address,time,host,direction,description,
>       cal,reminder from firesides and select extract( DOY FROM date)
>       where date > '$dstr1' and date <= '$dstr2'");
>    if ($sth->execute)
>    {
># assign each query record to an array
>        $numrow = 0;
>     while
>        (($date,$address,$time,$host,$directions,$description,$cal,$reminder,
>$db_doy) = $sth->fetc\
>hrow)
>
>
>
As per me the error is quite evident  because  it must be some thing
like this

select extract(DOY FROM date'COLUMN_FIELD')

CREATE TABLE test_date (
  "id" BIGSERIAL,
  "exp_date" DATE,
  "comp_int" int,
  PRIMARY KEY("id")
)

add some data
and do as

prompt=# select comp_int as Compared_Integer , extract( DOY from
exp_date) as Compared_Date from test_date where  id = 1 ;
 compared_integer | compared_date
------------------+---------------
                1 |           335
(1 row)

this may gve you results .

Regards,
V kashyap





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

Предыдущее
От: hodges@xprt.net
Дата:
Сообщение: Re: comparring dates between perl and postgres
Следующее
От: Wolfgang Rohdewald
Дата:
Сообщение: Re: multiline PL/Python function fails in *.sql