pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedNeed some SQL help
2+ messages / 2 participants
[nested] [flat]
* Need some SQL help
@ 2002-10-06 15:41 Brian Ward <brian0@verizon.net>
2002-10-07 12:27 ` Re: Need some SQL help Dan Langille <dan@langille.org>
0 siblings, 1 reply; 2+ messages in thread
From: Brian Ward @ 2002-10-06 15:41 UTC (permalink / raw)
To: pgsql-sql
I have a table
id int
status int
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Need some SQL help
2002-10-06 15:41 Need some SQL help Brian Ward <brian0@verizon.net>
@ 2002-10-07 12:27 ` Dan Langille <dan@langille.org>
0 siblings, 0 replies; 2+ messages in thread
From: Dan Langille @ 2002-10-07 12:27 UTC (permalink / raw)
To: Brian Ward <brian0@verizon.net>; +Cc: pgsql-sql
On Sun, 6 Oct 2002, Brian Ward wrote:
> I have a table
> id int
> status int
> 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
select * from table order by id, create_dt
If you want this information only for a specific date, when add in a
where clause : where create_dt GT 'some date'
Change Gt to the greater than character, which isn't working on this
keyboard...
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-10-07 12:27 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-06 15:41 Need some SQL help Brian Ward <brian0@verizon.net>
2002-10-07 12:27 ` Dan Langille <dan@langille.org>
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