Re: [SQL] how to calculate differences of timestamps?

2011-09-26 Thread Tim Landscheidt
(anonymous) wrote: > How could I calculate differences of timestamps in a log-table? > Table log ( user_id integer, login boolean, ts timestamp ) > So login = true would be a login-event and login = false a logout. > Is there a way to find the matching login/logout to > calculate the difference?

[SQL] how to calculate differences of timestamps?

2011-09-26 Thread Andreas
How could I calculate differences of timestamps in a log-table? Table log ( user_id integer, login boolean, ts timestamp ) So login = true would be a login-event and login = false a logout. Is there a way to find the matching login/logout to calculate the difference? Or is there a better tabl

Re: [SQL] handling duplicate row exception

2011-09-26 Thread Filip Rembiałkowski
W dniu 22 września 2011 08:11 użytkownik Amar Dhole napisał: > ** > > Hi Filip, > > ** ** > > No not sure 100% when this can happen. This approach will not be possible > as in our application we are programmatically handling these cases and going > in other route to add the record with increas

Re: [SQL] help with xpath namespace

2011-09-26 Thread Brian Sherwood
Yep, that did it. Thanks! 2011/9/23 Filip Rembiałkowski : > > > 2011/9/22 Brian Sherwood >> >> select (xpath('/chassis-inventory/chassis/serial-number/text()', >>        data_xml, >>        ARRAY[ARRAY['junos', >> 'http://xml.juniper.net/junos/9.6R4/junos-chassis']] >>       )) from xml_test; >