Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need help on a query!!!
with pure sql, the only way you'd be able to do it is if you knew the
maximum number of logins per userid. you'd be able to use a pivot
query. but what is supposed to happen when the same user has logged
in 100 times? your resultset grows to a hundred (and one) columns?
jackie_ol_at_hotmail.com (Jackie) wrote in message news:<2c196db8.0210082151.32f567bc_at_posting.google.com>...
> Hi!
> I have a table structured like shown below:
> USERID LOGIN_DATE
> --------- ------------------
> 100200 10-11-2002
> 100200 09-08-2002
> 100200 10-11-2002
> 400300 05-06-2002
> 400300 05-06-2002
> 500200 01-01-2002
> 500200 02-02-2001
> 600100 01-08-2002
>
> I want to write a query that returns a table like this:
>
> USERID LOGIN_DATE1 LOGIN_DATE2 LOGIN_DATE3
> --------- ----------- ----------- -----------
> 100200 10-11-2002 09-08-2002 10-11-2002
> 400300 05-06-2002 05-06-2002
> 500200 01-01-2002 02-02-2001
> 600100 01-08-2002
>
> Can anyone help me?
> Thanks in advance...
Received on Wed Oct 09 2002 - 12:51:05 CDT