SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2004
    Location
    Boston
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select where value !distinct?

    Hello,

    I am trying to find duplicate entries in my database. I am having a bit of trouble though. Is there a query that will select values from a column that are not distinct?

    Something that would workd like :

    PHP Code:
    $sql "Select title from table where title ! distinct()"
    Thanks

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    Code MySQL:
    SELECT title 
    FROM table 
    GROUP BY title
    HAVING COUNT(*) > 1

  3. #3
    SitePoint Evangelist
    Join Date
    Apr 2004
    Location
    Boston
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    Code MySQL:
    SELECT title 
    FROM table 
    GROUP BY title
    HAVING COUNT(*) > 1
    Perfect, thank you.


Bookmarks

Posting Permissions

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