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 <[EMAIL PROTECTED]>
http://home.zf.jcu.cz/~zakkr/
C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])