Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    48

    Unanswered: duplicate rows??

    hi all..
    how will i fetch duplicate rows in a table i want the count also
    eg in my table if the same company name exist morethan once i want to fetch it

    thnks in advance
    Jag

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    duplicate rows is not the same thing as multiple rows with the same value in a particular column

    presumably if your table has a primary key, you will never have a duplicate row

    for your question about company names, try this --
    Code:
    select companyname
         , count(*) as rows
      from daTable
    group by companyname
    having count(*) > 1
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jul 2004
    Posts
    48

    thnks

    u r right
    its not duplicate its multiple nd thnks for ur query

Posting Permissions

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