seany123 Posted September 4, 2011 Share Posted September 4, 2011 Can anyone tell me why this isnt working? $query1 = mysql_query("SELECT DISTINCT * FROM `series` WHERE `name` LIKE 'A%' ORDER BY `name` ASC LIMIT 12"); it should not display duplicates, but it does... Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/ Share on other sites More sharing options...
voip03 Posted September 4, 2011 Share Posted September 4, 2011 You also cannot specify DISTINCT if the SELECT list contains LOB( ORDER ) columns Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1265460 Share on other sites More sharing options...
seany123 Posted September 7, 2011 Author Share Posted September 7, 2011 so there is no work arounds to get this to work? Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1266259 Share on other sites More sharing options...
fenway Posted September 7, 2011 Share Posted September 7, 2011 You also cannot specify DISTINCT if the SELECT list contains LOB( ORDER ) columns Why not? Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1266276 Share on other sites More sharing options...
seany123 Posted September 8, 2011 Author Share Posted September 8, 2011 What i have found is that you cant have DISTINCT in a query that you are SELECT * FROM it has to be SELECT name FROM but this is very annoying, i want to select * the values, but some of the values wont pass the DISTINCT test... because they arnt unique... so im slightly confused as to what to do now... maybe i could make a query to collect all the data from the DISTINCT query.. hmm Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1266942 Share on other sites More sharing options...
fenway Posted September 8, 2011 Share Posted September 8, 2011 Sure can combine DISTINCT with * -- but if you have a UID in that table, the DISTINCT isn't doing anything. Explicitly list the fields you want back, and you'll be pleasantly surprised. Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1266965 Share on other sites More sharing options...
Muddy_Funster Posted September 8, 2011 Share Posted September 8, 2011 ... Explicitly list the fields you want back, and you'll be pleasantly surprised. Deffinately my quote of the week! Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1267012 Share on other sites More sharing options...
voip03 Posted September 8, 2011 Share Posted September 8, 2011 You also cannot specify DISTINCT if the SELECT list contains LOB( ORDER ) columns Why not? Please read the article http://psoug.org/definition/DISTINCT.htm Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1267053 Share on other sites More sharing options...
fenway Posted September 8, 2011 Share Posted September 8, 2011 You also cannot specify DISTINCT if the SELECT list contains LOB( ORDER ) columns Why not? Please read the article http://psoug.org/definition/DISTINCT.htm Um, no -- this isn't ORACLE. Link to comment https://forums.phpfreaks.com/topic/246430-help-using-distinct-with-select/#findComment-1267108 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.