Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  View Answers    Answer this question    Ask a question  
 

bhatupawar
Dec 18, 2009, 04:36 AM
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
Dec 18, 2009, 08: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 (http://dev.mysql.com/doc/refman/5.1/en/string-functions.html)
Peace,
Clarke

slapshot_oi
Dec 18, 2009, 10: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
Dec 18, 2009, 10: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.