Received: from nt-exchange.ifas.ufl.edu (nt-exchange.ifas.ufl.edu [128.227.242.250]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5PM8va59655 for ; Mon, 25 Jun 2001 18:08:57 -0400 (EDT) (envelope-from wherring@mail.ifas.ufl.edu) Received: from MARWherring (mari25.marianna.ifas.ufl.edu [150.176.77.25]) by nt-exchange.ifas.ufl.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id NM13SF63; Mon, 25 Jun 2001 18:08:52 -0400 From: "William Herring" To: Subject: select with multiple occurences in same table Date: Mon, 25 Jun 2001 17:08:39 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0005_01C0FD99.7A699FA0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200106/405 X-Sequence-Number: 3702 This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C0FD99.7A699FA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Table "inventorytrack" Attribute | Type | Modifier ------------+-----------+---------- tattoo | text | past_group | text | ranch | text | ent_date | timestamp | indate | date | In the above table, I have multiple occurrences of ‘tattoo’. However, some of the tattoo’s have null value in ‘indate’, some do not. I would like to select those tattoos with a null indate, unless there is another identical tattoo in the table that has a date value in ‘indate’. For example, I might have: tattoo | past_group | ranch | ent_date | indate --------+----------------+--------+------------------------+------------ 1039 | Barn2/Behind | Iberia | 2000-03-16 11:03:32-08 | 1039 | Across/Bubs | Iberia | 2000-12-28 14:57:13-08 | 2000-12-28 1832 | GardnerBlock#3 | Iberia | 2000-03-16 11:03:32-08 | 1832 | GardnerBlock#2 | Iberia | 2000-12-28 12:46:57-08 | 2000-12-28 1833 | Becker1 | Iberia | 2000-03-16 11:03:32-08 | So the prospective SELECT would give back: tattoo | past_group | ranch | ent_date | indate 1039 | Across/Bubs | Iberia | 2000-12-28 14:57:13-08 | 2000-12-28 1832| GardnerBlock#2 | Iberia | 2000-12-28 12:46:57-08 | 2000-12-28 1833| Becker1 | Iberia | 2000-03-16 11:03:32-08 | Any suggestions on how to do this? ------=_NextPart_000_0005_01C0FD99.7A699FA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

      Table "inventorytrack"

 Attribute  |   Type  =   | Modifier

------------+-----------+----------<= /p>

 tattoo     | text      |

 past_group | text      |

 ranch      | text      |

 ent_date   | timestamp |

 indate     | date      |

 <= /span>

 <= /span>

In the above table, I have multiple occurrences of ‘tattooR= 17;.  However, some of the tattoo’= ;s have null value in ‘indate’, some do not.&nb= sp; a date value in  ̵= 6;indate’.  For example, I might have:

 <= /span>

tattoo |   past_group   | ranch  |        ent_date        |   indate

--------+----------------+--------+------------------------+--------= ----

 1039   | Barn2/Behind   | Iberia | 2000-03-16 11:03= :32-08 |

 1039   | Across/Bubs    | Iberia | 2000-12-28= 14:57:13-08 | 2000-12-28

 1832   | GardnerBlock#3 | Iberia | 2000-03-16 11:03:32-08 |

1832     | GardnerBlock#2 | Iber= ia | 2000-12-28 12:46:57-08 | 2000-12-28

1833     | Becker1            | Iberia | 2000-03-16 11:03:32-08 |<= /p>

 

 <= /span>

 <= /span>

 <= /span>

So the prospective SELECT would give back:<= /span>

 <= /span>

tattoo |   past_group   | ranch  |        ent_date        |   indate

1039   | Across/Bubs    | Ib= eria | 2000-12-28 14:57:13-08 | 2000-12-28

1832| GardnerBlock#2 | Iberia | 2000-12-28 12:46:57-08 | 2000-12-28<= o:p>

1833| Becker1            | Iberia | 2000-03-16 11:03:32-08 |<= /p>

 <= /span>

Any suggestions on how to do this?

------=_NextPart_000_0005_01C0FD99.7A699FA0--