Re: Help with SQL/report
Posted in 1998
Douglas Wilson — — source: Informix-list mailing list archive (1991-1998)
On Tue, 19 May 1998 21:00:50 GMT, dgwilson@gte.net (Douglas Wilson)
wrote:
>On Tue, 19 May 1998 20:51:52 GMT, dgwilson@gte.net (Douglas Wilson)
>wrote:
>>select *
>>from lithology a
>>where exists
>>(select 1
>> from lithology b
>> where
>> (a.top_depth between b.top_depth and b.bottom_depth or
>> a.bottom_depth between b.top_depth and b.bottom_depth)'between' is inclusive which is probably not what you want, so
expand the 'between' with '<' and '>' and then you won't need
the following line:
>> and a.lith_type != b.lith_type
>and a.official_name=b.official_name
>>)
>>
>>Hope that helps,
>>Douglas Wilson
>