Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   MySQL (https://www.askmehelpdesk.com/forumdisplay.php?f=442)
-   -   How to get unique recordes using find_in_set (https://www.askmehelpdesk.com/showthread.php?t=426109)

  • Dec 18, 2009, 05:36 AM
    bhatupawar
    How to get unique recordes using find_in_set
    Hi
    I want to get unique records from the database. I am using disting function in select clause but I am not getiing proper output. How to get unique recordes using find_in_set ?
    Please help me
  • Dec 18, 2009, 09:59 AM
    crigby

    Hi,
    That only returns the first instance of a string; sounds like you need a different approach. See:
    MySQL :: MySQL 5.1 Reference Manual :: 11.4 String Functions
    Peace,
    Clarke
  • Dec 18, 2009, 11:25 AM
    slapshot_oi

    DISTINCT returns one record if two or more identical records in the result set exist; it's a dataset function, not a string function.

    The primary key's job is to keep each record unique, and if your table doesn't have one, then DISTINCT should work provided each value of each field in each of the duplicate records are the same.

    Are you trying to return a single record, or a result set of all unique records? Paste your SQL, it seems like what your trying to do is really basic.
  • Dec 18, 2009, 11:28 AM
    ScottGem

    DISTINCT should work, but only if the records are complete duplicates. It might help if you gave us info about your table structure and what is duplicated.

  • All times are GMT -7. The time now is 04:27 AM.