Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2006
    Posts
    3

    Unanswered: Get rid of maximun and minimun values among several fields

    This is it, say i have six numeric fields to fill in.
    What i need is to get rid of the biggest and smallest numbers among these six fields, so i can take into account just the middle four left fields. It's a system for ranking persons performances.

    For example:
    field#1= 6.3
    field#2= 2.3
    field#3= 7.5
    field#4= 4.9
    field#5= 8.3
    field#6= 4.5

    and i need to get rid of the biggest and lowest entered values, in this case, i should get rid of fields #2 and #5

    How can i do this?. any idea?
    Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    that depends on what you mean by "get rid of"

    what are you actually trying to do, update the row?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2006
    Posts
    3
    Not really, i mean not to use them, maybe what i need is a subrecordset that doesn't take into account the highest and lowest values from those fields

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    could you show the query that you want to use the middle 4 fields in?

    i'm having a hard time picturing a "subrecordset"
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Sep 2006
    Posts
    3
    Hi,
    it's done. I'v used the LIMIT function to get rid of the last and first values.
    Now, is there a way to sum these middle values?, i've tried the SUM() but had no luck.

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    use SUM() in an outer query, put your query as the subquery
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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