ok Posted September 3, 2008 Share Posted September 3, 2008 hi guys let say i have a field and this field has many records. but some record have duplicates. now how can i select the uniqe record name only in the field? for example, user_name ----------- john john joey joe gina karen warren karen george warren i want to select them all but not including the duplicate so if i want to select the the name only not including the dupliate then the result is user_name ----------- john joey joe gina karen warren george can you show me the right mysql select command please. Thank you. Quote Link to comment Share on other sites More sharing options...
lemmin Posted September 3, 2008 Share Posted September 3, 2008 I think this should work: "SELECT user_name FROM table GROUP BY user_name" Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 3, 2008 Share Posted September 3, 2008 SELECT DISTINCT user_name FROM users or SELECT user_name FROM users GROUP BY user_name EDIT: Lemmin beat me to it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.