timestamp

voledy
Дата: 14.11.2008 22:42:55
здарвтуйте!!!..
вопрос по работе с типом timestamp...

вот запрос...
select case when time_out > time_in then time_in+1 else time_in end - time_out from trip

вот результат..

+000012000 00:00:00.000000000
+000012780 00:00:00.000000000
+000040800 00:00:00.000000000
+000039000 00:00:00.000000000
+000006480 00:00:00.000000000
+000007560 00:00:00.000000000
+000006540 00:00:00.000000000
+000006900 00:00:00.000000000
+000007020 00:00:00.000000000
+000007080 00:00:00.000000000
+000006060 00:00:00.000000000
+000006300 00:00:00.000000000
+000036000 00:00:00.000000000
+000050400 00:00:00.000000000
+000036000 00:00:00.000000000
+000057600 00:00:00.000000000
+000039600 00:00:00.000000000
+000050400 00:00:00.000000000
+000043200 00:00:00.000000000
+000050400 00:00:00.000000000
+000003600 00:00:00.000000000
+000003600 00:00:00.000000000

как получить результат в минутах, а не интервалах ???



---------
:o)=|=<
voledy
Дата: 14.11.2008 22:44:34
вот правильный результат запроса...


+000000000 03:20:00.000
+000000000 03:33:00.000
+000000000 11:20:00.000
+000000000 10:50:00.000
+000000000 01:48:00.000
+000000000 02:06:00.000
+000000000 01:49:00.000
+000000000 01:55:00.000
+000000000 01:57:00.000
+000000000 01:58:00.000
+000000000 01:41:00.000
+000000000 01:45:00.000
+000000000 10:00:00.000
+000000000 14:00:00.000
+000000000 10:00:00.000
+000000000 16:00:00.000
+000000000 11:00:00.000
+000000000 14:00:00.000
+000000000 12:00:00.000
+000000000 14:00:00.000
+000000000 01:00:00.000
+000000000 01:00:00.000

---------
:o)=|=<
SY
Дата: 14.11.2008 23:51:22
To round use:

select  round((cast(case when time_out > time_in then time_in+1 else time_in end as date) - cast(time_out as date)) *24 * 60)
  from  trip
/

SY.
voledy
Дата: 15.11.2008 00:03:52
SY
To round use:

select  round((cast(case when time_out > time_in then time_in+1 else time_in end as date) - cast(time_out as date)) *24 * 60)
  from  trip
/

SY.


спасибо большое!!!...