Results 1 to 1 of 1

Thread: Depending data

  1. #1
    Join Date
    Jan 2003
    Posts
    26

    Unanswered: Depending data

    Scenario:

    John 23 year likes football and hockey seeks woman 30-40 year who likes cooking.

    Anna 32 year likes cooking and driving seeks man 20-25 year who likes football and hockey.


    The table is structed like this:

    Code:
    ID	desc		cat	type
    ---------------------------------------------------------------
    john	football		sport	p	
    john	hockey		sport	p
    john	cooking		food	s
    
    anna	cooking		food	p
    anna	driving		hobby	p
    anna	football		sport	s
    anna	hockey		sport	s
    The problem with this is that when I make a SP to find those users who John is seeking it will return Anna, and now I have to check if Anna is seeking John. And since Johns seeking can return over 30000 possible users, I will have to loop through all this and run the SP for all those possible users.

    How can I do this in another way?

    p means personal information
    s means seeking information.

    example:

    john football sport p
    john hockey sport p
    john cooking food s

    means:

    john plays/likes football and hockey and is searching for a person that likes cooking.

    I get age/sex from another table.

    There is also another problem related with this.

    When John is searching for a person that likes cooking he does that in a category called food. And the person that match have to match exactly all the criterias that John has said that he is searching for.

    Example:

    Code:
    ID     desc          cat     type
    ---------------------------------------------------------------
    john     football          sport     p     
    john     hockey          sport     p
    john     cooking          food     s
    john     fish                food     s
    john     flying             hobby   s
    
    anna     cooking          food     p
    anna     cooking          food     p
    anna     football          sport     s
    anna     hockey          sport     s
    
    susan    cooking           food     p
    susan    flying              hobby     p
    susan    rally               sport     s
    susan    hockey           sport     s

    If John makes a search he is saying that he is searching for a person that likes cooking _or_ fish (or since its the same category) and likes flying.
    The result that should be returned would be susan, since she likes flying and cooking. John said he wanted a person that likes fish also but since that was in the same category as cooking it would not matter.
    John would not get a hit on anna since she does not answer to his request in liking flying, even that she has the correct fit in the category food.

    With me?

    Last edited by Brimba; 06-24-03 at 10:03.

Posting Permissions

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