Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    78

    Unanswered: query for repeating values

    Hai

    This is my data in my table .I want query for repeating groupid values(example
    (8,8,3 ) not 12,5

    Any idea
    Regards
    mohan

    groupid groupelementid groupelementtype sorder

    8 3 paragraph 1
    12 5 paragraph 2
    8 6 paragraph 1
    3 3 paragraph 2
    5 4 paragraph 2
    3 9 paragraph 1

  2. #2
    Join Date
    Jan 2003
    Location
    Woking
    Posts
    107

    Re: query for repeating values

    Originally posted by mohan
    Hai

    This is my data in my table .I want query for repeating groupid values(example
    (8,8,3 ) not 12,5

    Any idea
    Regards
    mohan

    groupid groupelementid groupelementtype sorder

    8 3 paragraph 1
    12 5 paragraph 2
    8 6 paragraph 1
    3 3 paragraph 2
    5 4 paragraph 2
    3 9 paragraph 1
    Hi,

    This query will return only the distinct values,

    SELECT groupid
    FROM my_table
    GROUP BY groupid
    HAVING COUNT(*) > 1

    If you want all the records, then

    SELECT *
    FROM my_table
    WHERE groupid
    IN (
    SELECT groupid
    FROM my_table
    GROUP BY groupid
    HAVING COUNT(*) > 1)
    /

    Hope It Helps.
    Thanks
    nn

  3. #3
    Join Date
    Oct 2002
    Posts
    78

    Hai

    Thanks for your prompt reply.My problem is solved now

    Regards
    mohan

Posting Permissions

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