build table from "logging" table, one row per user - oldest date
From: okey <oldyork90_at_yahoo.com>
Date: Thu, 16 Sep 2010 16:37:54 -0700 (PDT)
Message-ID: <62e6dec5-4d84-44e4-8d63-81f9e14f265d_at_u13g2000vbo.googlegroups.com>
I have a “logging” table. It records the user, login time, and other things.
Date: Thu, 16 Sep 2010 16:37:54 -0700 (PDT)
Message-ID: <62e6dec5-4d84-44e4-8d63-81f9e14f265d_at_u13g2000vbo.googlegroups.com>
I have a “logging” table. It records the user, login time, and other things.
I want to create table within a statement that returns one row for each user. This row is the row containing the user’s oldest date
Select blah blah from table x, (select user, date, other, info from
logging where date is max) oldrows
where x.date < oldrows.date
and x.user = oldrows.user
It’s building the table here that looks very difficult. This would be easy enough to do in pl/sql, but I rather do it this way, if it can even be done. This kind of thing is going to come up a lot.
Thank you Received on Thu Sep 16 2010 - 18:37:54 CDT