Re: [GENERAL] mysql query to postgres Timediff

2010-12-02 Thread Pavel Stehule
Hello PostgreSQL hasn't a timediff function and hasn't a session variables. You can see how can be implemented this function in pg http://okbob.blogspot.com/2009/08/mysql-functions-for-postgresql.html. If you can compare values from different rows, you have to have a pg >= 8.4 with window function

[GENERAL] mysql query to postgres Timediff

2010-12-02 Thread franrtorres77
Hello I have the next query in mysql to get the time difference from two rows, but I would like to implement it in postgres, but I'm getting some errors when I try to query it. select speed,mobile,date, timediff(@nexttime,date) as tdiff2, (@nexttime:=date) as Next from positions where speed=0 an