Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Location
    Minnesota
    Posts
    6

    Unanswered: Sorting By multiple similar entries

    Hi I was wondering if someone could help me out. I'm trying to sort a database to show only entries that have dates that reoccur. So as an example if you have

    a 01/27/29
    b 01/28/29
    c 01/22/29
    d 01/27/29
    e 01/22/29

    only a c d and e would show since their dates occur more than once. I tried doing this for an hour but obviously I'm to much of a newb to do such a simple task ;-)

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you did not show us your table layout, so i'm going to assume your table consists of two columns -- a letter and a date
    Code:
    SELECT t.theletter
         , t.thedate
      FROM ( SELECT thedate
               FROM daTable
             GROUP
                 BY thedate
             HAVING COUNT(*) > 1 ) AS m
    INNER
      JOIN daTable AS t
        ON t.thedate = m.thedate
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2010
    Location
    Minnesota
    Posts
    6
    actually whats funny is I was using queries and I went into make a new query for some other reason and then I look down a little and see duplicates query so I decide to give that a shot and it did all that for me. Thanks for the reply though. And also by the way that's exactly what it put into criteria... Well the format of it is.

Posting Permissions

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