[SQL] Need some SQL help

2002-10-07 Thread Brian Ward

I have a table
id int
statusint
create_dt datetime

When users log in and out I insert a row into this table throughout the day.
I'm trying though to come up with a querie to tell me and ordering of users
as they report in in the morning so i'm trying to say
select each user and the earliest time the logged in in a give day, then
order that by the create_dt column.

Having trouble writing the SQL though



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [SQL] timestamp

2002-10-07 Thread Brian Ward

I think I got it but I'm not sure if it's correct.
I put the default as CURRENT_TIMESTAMP but I though I had read that was
being taken out and only now was supported?

Does anyone know?

"Brian Ward" <[EMAIL PROTECTED]> wrote in message
anphrb$24se$[EMAIL PROTECTED]">news:anphrb$24se$[EMAIL PROTECTED]...
> How do I create a time stamp column in a table that default to the current
> time
> when a row is inserted?
> I tried putting in now() as the default but I have something wrong
> with the syntax or something I think
> Any one have an example of a table creation script that has a timestamp
> column?
>
>



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] timestamp

2002-10-07 Thread Brian Ward

How do I create a time stamp column in a table that default to the current
time
when a row is inserted?
I tried putting in now() as the default but I have something wrong
with the syntax or something I think
Any one have an example of a table creation script that has a timestamp
column?



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] functions that return a dataset or set of rows

2002-10-18 Thread Brian Ward
How do I create a function that returns a set of row;

I can't seem to find the datatype that the return set should be declared as.



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])