"OizOne" <rautaon(at)nic(dot)fi> writes:
> I would need to create a query that selects each hostname only once with
> username that has the latest timestamp in the logontime column.
SELECT DISTINCT ON is a convenient way to do this. See the "weather
reports" example in the SELECT reference page for a similar case.
regards, tom lane
In response to
pgsql-sql by date
|Next:||From: Denis||Date: 2004-01-19 04:58:01|
|Subject: Re: Left joins with multiple tables|
|Previous:||From: Robert Creager||Date: 2004-01-19 04:28:34|
|Subject: How can I get the last element out of GROUP BY sets?|