help with sql query

From: Peter <peterpub1(at)aboutsupport(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: help with sql query
Date: 2006-10-17 07:27:17
Message-ID: 453485D5.9070705@aboutsupport.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Lets suppose I have a table like this one

id id_1 id_2 date_time
1 101 1000 2006-07-04 11:25:43
2 102 1001 2006-07-04 11:26:43
3 101 1005 2006-07-04 11:27:43
4 103 1000 2006-07-04 11:25:43

I want to find all records have same id_1, but different id_2 and have
difference in time less than 5 minutes.

In this case this is record 1 and record 3.

How can I do this ?

Thanks in advance for your help.

Peter

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Felix Zhang 2006-10-17 07:39:21 How to split a table?
Previous Message Albe Laurenz 2006-10-17 06:58:53 Re: Using Sockets in postgres