woolyg Posted June 13, 2007 Share Posted June 13, 2007 Hi all, I'm running an SQL query that returns the following results: Value FirstName Surname Number NULL Mel Brooks 4 1001 JIm Jones 9652 13 JR Ewing 5 13 JR Ewing 9651 2 S R 2 5678 Euan S 6 8888 John Ryan 3 But I only want JR Ewing to show up once. Could anyone advise me on how to do this? I've tried using SELECT DISTINCT (Value), FirstName, SurName etc ..but it still shows up twice, as JR Ewing has 2 entries in the Number column. Can anyone help? Cheers Woolyg Quote Link to comment https://forums.phpfreaks.com/topic/55374-returning-only-one-row-out-of-many/ Share on other sites More sharing options...
sushant_d84 Posted July 2, 2007 Share Posted July 2, 2007 what is the Data Type of Value? Quote Link to comment https://forums.phpfreaks.com/topic/55374-returning-only-one-row-out-of-many/#findComment-287883 Share on other sites More sharing options...
yatt Posted July 19, 2007 Share Posted July 19, 2007 Try this SELECT DISTINCT FirstName,* FROM table ORDER BY FirstName Quote Link to comment https://forums.phpfreaks.com/topic/55374-returning-only-one-row-out-of-many/#findComment-301995 Share on other sites More sharing options...
DeadEvil Posted July 19, 2007 Share Posted July 19, 2007 Your table is not normalized properly. Quote Link to comment https://forums.phpfreaks.com/topic/55374-returning-only-one-row-out-of-many/#findComment-302115 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.