What about sub selects. As I see it you only care about the highest
and lowest order of results in each list.
Sorry, in am on a mobile so I can nit make a test case, and this will
be pseudo SQL.
Select * from table where start = (select foo) and ( select foo) ...
Also look at the between
abhishek@gmail.com (Abhishek Pratap) writes:
I am kind of stuck with this query , cant expand my thinking. May this is a
limitation. Here it is
I have a database with many cols two of which are start and end position for
an event.
Now I have a list of event time stamps, I want to
Hi All
I am kind of stuck with this query , cant expand my thinking. May this is a
limitation. Here it is
I have a database with many cols two of which are start and end position for
an event.
Now I have a list of event time stamps, I want to find all the info once the
current event time
aah okie I think I was trying to get too clever. Guess that won't work ...
Thanks,
-Abhi
On Fri, May 8, 2009 at 12:34 PM, Barney Boisvert bboisv...@gmail.comwrote:
You'll have to iterate over your two lists of timestamps and build a
set of ORed conditional pairs:
sql = select ... from ...
why not something like below. Assume you have 3 pairs of start/end
timestamps and you want to find everything within those 3 time periods:
select * from table_name where start = start1 and end = end1
union
select * from table_name where start = start2 and end = end2
union
select * from
Hi Jim
Unfortunately I have thousands of such points. So explicit statement calling
will be very expensive both computationally and in terms of writing..
Thanks,
-Abhi
On Fri, May 8, 2009 at 12:37 PM, Jim Lyons jlyons4...@gmail.com wrote:
why not something like below. Assume you have 3 pairs
Abhi,
I might not be understanding the problem but could you use the max
and min timestamp values and use something like
SELECT * FROM TABLE WHERE start BETWEEN max AND min AND end BETWEEN max AND min
or
SELECT * FROM TABLE WHERE START IN (1,2,3,4,5) AND END IN(1,2,3,4,5)
I might be
then either build the statement by way of a program like a perl script or
select all records with a start time after the min start time of all in your
list and an end time less than the max end time in your list then filter
them further either in a program or a store procedure.
On Fri, May 8,