Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Timestamp SQL question
Oxnard wrote:
> Sorry if I did not make myself clear.
> The query
>
> select username, sid, serial#, logon_time, to_timestamp(logon_time)
> from v$session
> where to_timestamp(logon_time) = (select to_timestamp(logon_time)
> from v$session where
> username = 'SYS')
> order by logon_time
>
> should only be returning one row assuming there is one connection as SYS and
> no other user logged on at the same time as SYS. However I find all rows are
> returned. That is what I am wondering why.
You were very clear but that is not what your query is written to do. And the difference, I thought, would be clear if you ran my modification of your SQL statement. So lets do this in words rather than pictures.
Run the query I provided you again and it should be very obvious that what you have written does not do what you want. As I tell my students: Computers do what you ask them to do ... not what you want them to do.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Mon Jul 18 2005 - 11:25:48 CDT