Ask Experts Questions for FREE Help !
Ask
    bhatupawar's Avatar
    bhatupawar Posts: 1, Reputation: 1
    New Member
     
    #1

    Dec 18, 2009, 05:36 AM
    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
    crigby's Avatar
    crigby Posts: 4,343, Reputation: 107
    Outdoor Power Equipment Expert
     
    #2

    Dec 18, 2009, 09:59 AM

    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
    slapshot_oi's Avatar
    slapshot_oi Posts: 1,537, Reputation: 589
    Ultra Member
     
    #3

    Dec 18, 2009, 11:25 AM

    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.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Dec 18, 2009, 11:28 AM

    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Are you Unique [ 5 Answers ]

How can you just be yourself around people and make them like you? I really don't understand that, what do you have to do to be yourself- can I have some examples of how to make friends but not to be fake and not to suck up to them to make them like me... :confused:

Unique deck job [ 1 Answers ]

Hey Guys, Nichols Trim Here With Question, Were Looking At Building A Deck With A Brick Foundation And Composite Decking On Top, It Will Have 3 Steps With (brick) Risers. And That's My First Of 2 Questions, Ive Got A Pic Of It But Does Anyone Know Of A Good Way To Pull This Off. Also The Band Of...

Unique [ 30 Answers ]

What makes a mistake unique?

Looking for unique clothes [ 3 Answers ]

I want to find some clothes that may be rave/futuristic/technoey ( I think I just made a new word )/ j.street style looking. Can anyone help? :cool:


View more questions Search