List:General Discussion« Previous MessageNext Message »
From:Scott Haneda Date:May 10 2009 9:32pm
Subject:Re: Help with mysql query, multiple list
View as plain text  
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" and "in" keywords.

Perhaps your list of timestamps is not in a database, can you put then  
in?

Either way unless I am reading you wrong you only need the greatest  
and lowest time in your comparison, not a huge list.
-- 
Scott
Iphone says hello.

On May 8, 2009, at 9:26 AM, Abhishek Pratap <abhishek.vit@stripped>  
wrote:

> 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 stamp is >= start time of event and <=end time of  
> event.
>
> something  like this
>
> select * from table_name where start <= ( LIST of time stamps) AND  
> end >=(
> list of time stamps).
>
> Clearly above query accepts only one item in the list. Is there a  
> way to do
> this for multiple items in the list ??? I can't think of anything at  
> this
> moment.
>
>
> Thanks,
> -Abhi
Thread
Help with mysql query, multiple listAbhishek Pratap8 May
  • Re: Help with mysql query, multiple listJim Lyons8 May
    • Re: Help with mysql query, multiple listAbhishek Pratap8 May
      • Re: Help with mysql query, multiple listJim Lyons8 May
  • Re: Help with mysql query, multiple listSimon J Mudd9 May
  • Re: Help with mysql query, multiple listScott Haneda10 May
Re: Help with mysql query, multiple listAbhishek Pratap8 May
  • Re: Help with mysql query, multiple listKyong Kim8 May