|
|
|
|
|
|
| Re: Data selection on basis of columns from two consecutive rows [message #639279 is a reply to message #639277] |
Sat, 04 July 2015 04:32   |
 |
pankajmaurya55
Messages: 2 Registered: July 2015 Location: India
|
Junior Member |
|
|
i am using this query now
select a.* from
(select table.*, lag(date_and_time,1,0) over (order by called_party) as t2,lag(called_party,1,0) over (order by called_party) as c2 from table where duration < 10 order by calling_no, called_party, date_and_time) a
where a.called_party=c2
and a.date_and_time between (to_char(to_date(t2,'dd-mon-yyyy hh:mi:ss am')+1/(24*60*60),'dd-mon-yyyy hh:mi:ss am')) and (to_char(to_date(t2,'dd-mon-yyyy hh:mi:ss am')+360/(24*60*60),'dd-mon-yyyy hh:mi:ss am'))
the issue is that it is only retrieving only first call, i want that second call also.i.e from (1) and (2) it gives only (1)
[Updated on: Sat, 04 July 2015 04:34] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|