pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karel Zak <zakkr@zf.jcu.cz>
To: waheed_rahuman <waheed_rahuman@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL Date  help
Date: Mon, 26 Mar 2001 10:58:06 +0200
Message-ID: <20010326105806.C19983@ara.zf.jcu.cz> (raw)
In-Reply-To: <00e001c0b5ce$21de96a0$660101c8@emirates.net.ae>
References: <20010325065031.26528.qmail@web1001.mail.yahoo.com>
	<00e001c0b5ce$21de96a0$660101c8@emirates.net.ae>

On Mon, Mar 26, 2001 at 12:24:07PM +0400, waheed_rahuman wrote:
> 
> 
> Hi,
> 
> I am a newbie to SQL and postgresql too.
> please guide me in the following...

 Any problem with documentation?

> 1.How i can create date while i am inserting into the table ,in which the
> field is date data type.(date should not be a current date and its should be
> created
> as in java date(int,int,int)

 INSERT INTO xxx VALUES (now());
 INSERT INTO xxx VALUES ('2000-01-01');

> 2. How i can compare the date field.

via standard operators, en example '<' '>' '=' 'between' ..etc. 

> For example ,
> how i can get the all the records between to two dates

  SELECT .... WHERE col BETWEEN '2000-01-01' AND '2001-01-01';
 
 Please(!), see

http://www.postgresql.org/users-lounge/docs/7.0/user/datatype.htm
http://www.postgresql.org/users-lounge/docs/7.0/user/operators.htm
http://www.postgresql.org/users-lounge/docs/7.0/user/operators2373.htm  

		Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz



view thread (2+ messages)

Message-ID: <20010326105806.C19983@ara.zf.jcu.cz>
Permalink:  ../20010326105806.C19983@ara.zf.jcu.cz/
Also on:    postgresql.org/message-id/20010326105806.C19983@ara.zf.jcu.cz

 · 

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: zakkr@zf.jcu.cz, waheed_rahuman@yahoo.com
  Subject: Re: SQL Date  help
  In-Reply-To: <20010326105806.C19983@ara.zf.jcu.cz>
  References: <20010325065031.26528.qmail@web1001.mail.yahoo.com> <00e001c0b5ce$21de96a0$660101c8@emirates.net.ae> <20010326105806.C19983@ara.zf.jcu.cz>

* 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