Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Full Text Query

Full Text Query

Scheduled Pinned Locked Moved Database
database
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Muhammad Fahim Baloch
    wrote on last edited by
    #1

    I want to Delete Duplicate records From a table **except the Max(ID)**Using Full Text Query. and Duplicate records are just certain field not an entire row in a table. and I have millions of records in my table.........

    W 1 Reply Last reply
    0
    • M Muhammad Fahim Baloch

      I want to Delete Duplicate records From a table **except the Max(ID)**Using Full Text Query. and Duplicate records are just certain field not an entire row in a table. and I have millions of records in my table.........

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Muhammad Fahim Baloch wrote:

      I want to Delete Duplicate records From a table except the Max(ID)

      You should be more specific how you define duplicate. Obviously you wnat to save the latest, but what's duplicate for you in this case.

      Muhammad Fahim Baloch wrote:

      Using Full Text Query

      How does this relate to duplicates?

      Muhammad Fahim Baloch wrote:

      Duplicate records are just certain field

      Which fields? It would be easiest if you provide a dessciption of the table and tell that based on what columns you want to observe the duplicates.

      Muhammad Fahim Baloch wrote:

      I have millions of records in my table

      And how does this relate? Concerned about the speed perhaps?

      The need to optimize rises from a bad design.My articles[^]

      M 1 Reply Last reply
      0
      • W Wendelius

        Muhammad Fahim Baloch wrote:

        I want to Delete Duplicate records From a table except the Max(ID)

        You should be more specific how you define duplicate. Obviously you wnat to save the latest, but what's duplicate for you in this case.

        Muhammad Fahim Baloch wrote:

        Using Full Text Query

        How does this relate to duplicates?

        Muhammad Fahim Baloch wrote:

        Duplicate records are just certain field

        Which fields? It would be easiest if you provide a dessciption of the table and tell that based on what columns you want to observe the duplicates.

        Muhammad Fahim Baloch wrote:

        I have millions of records in my table

        And how does this relate? Concerned about the speed perhaps?

        The need to optimize rises from a bad design.My articles[^]

        M Offline
        M Offline
        Muhammad Fahim Baloch
        wrote on last edited by
        #3

        I have a table, which has two rows 1.EmailID 2.EmailAddress I have Duplicate Email Addresses and i want to Delete Duplicate Email Addresses from my table except the max(emailId) and I have millions of Duplicate EmailAddresses in my table Plz ans me as soon as possible.... Thanks!

        W 1 Reply Last reply
        0
        • M Muhammad Fahim Baloch

          I have a table, which has two rows 1.EmailID 2.EmailAddress I have Duplicate Email Addresses and i want to Delete Duplicate Email Addresses from my table except the max(emailId) and I have millions of Duplicate EmailAddresses in my table Plz ans me as soon as possible.... Thanks!

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Muhammad Fahim Baloch wrote:

          I have Duplicate Email Addresses and i want to Delete Duplicate Email Addresses from my table except the max(emailId)

          You could try something like:

          delete from YourTable
          where exists (select 1
          from YourTable alias1
          where alias1.emailaddress = YourTable.emailaddress
          and alias1.emailid > YourTable.emailid)

          Remember to use begin transaction so that you can rollback if the result isn't what you wanted.

          Muhammad Fahim Baloch wrote:

          and I have millions of Duplicate EmailAddresses in my table

          This means that unless you have proper indexing this will take a while.

          The need to optimize rises from a bad design.My articles[^]

          M 1 Reply Last reply
          0
          • W Wendelius

            Muhammad Fahim Baloch wrote:

            I have Duplicate Email Addresses and i want to Delete Duplicate Email Addresses from my table except the max(emailId)

            You could try something like:

            delete from YourTable
            where exists (select 1
            from YourTable alias1
            where alias1.emailaddress = YourTable.emailaddress
            and alias1.emailid > YourTable.emailid)

            Remember to use begin transaction so that you can rollback if the result isn't what you wanted.

            Muhammad Fahim Baloch wrote:

            and I have millions of Duplicate EmailAddresses in my table

            This means that unless you have proper indexing this will take a while.

            The need to optimize rises from a bad design.My articles[^]

            M Offline
            M Offline
            Muhammad Fahim Baloch
            wrote on last edited by
            #5

            Hi Thnks a lot.............................. Thanku agian............................. You are doing greate job Thanks agian,,,,,,, By

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups