|
From table2 aWhere exists (select 1
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: donderdag 10 september 2009 13:52
To: Midrange Systems Technical Discussion
Subject: RE: Today's SQL Brain teaser
Peter,
Sorry about my error I've corrected it. Sorry also about the names, I
translated the French. I've tried your solution but your temptable only
returns two values, 5 and 36. For each line in table 2, I need to be
able to test if the No is between Start_x and end_x of all lines in
table1.
Table1
Start_x end_x
5 10
12 16
25 36
Table2
Id No
ID1 7
ID2 16
ID3 1
Hold on have I just answered my own question ? Join Table1 to table2
and select lines where No BETWEEN START_x and End_x. Will try that!
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.