Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2001
    Posts
    46

    Unanswered: Help,how to filter this database

    tblPerson
    ======
    person_ID
    person_Name
    person_IC
    person_tel

    tblPhone
    =====
    phone_id
    phone_NO

    tblLink
    ====
    person_ID
    phone_ID

    Questions
    =======
    Explain : Every [person] called out [tel_no] a lot of times within one month.All those telephone number that unique [person] called will be recored down to database.My BOSS want to know who are those <common number> between them.

    Definition : <common number> mean must have 2 person call the same telephone number,that telephone number will become <common number>

    1. How to set query to get the correct result where below condition appy
    personA --
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;|----- <telephone nymber> { called <[common number]
    personB---

    I want to get correct filter to display those telephone number that called by minimum 2 person or more then 2.

    Attached Thumbnails Attached Thumbnails link.gif  
    Last edited by edmun3; 01-23-03 at 12:35.

  2. #2
    Join Date
    Nov 2002
    Posts
    150

    Re: Help,how to filter this database

    2 queries will solve this with your current table structure:

    Create the following query and name it qryDistinct:
    SELECT DISTINCT PHONE_ID, PERSON_ID FROM TBLLINK;

    then

    Create this query:
    SELECT PHONE_ID
    FROM qryDistinct
    GROUP BY PHONE_ID
    HAVING COUNT(1) > 1

Posting Permissions

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