Results 1 to 2 of 2

Thread: query

  1. #1
    Join Date
    Jun 2002
    Posts
    173

    Unanswered: query

    I have two queries, I'll write out an example of each:

    query1:
    group# losses
    1 8000
    2 15000
    3 27500
    4 45000
    5 62500

    query2:
    losses
    8234
    500
    45678
    29000

    I'm trying to come up with a 3rd query or include in the 2nd query the ability to drop in the group# that is associated with the losses in query2. For example, record 1 in query 2 lists "8234". I'd like to have the result list group# 2 as it is greater than 8000 and less than 15000. Record 3 of query 2 would have a result of group# 1 as it is less than 8000 and greater than 0.
    Would anyone have any ideas to accomplish this? Any help would be appreciated thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try this --
    Code:
      select query2.losses , min( query1.losses )
        from query2 , query1
       where query2.losses < query1.losses
    group by query2.losses
    caution: untested but should work

    rudy
    http://rudy.ca/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •