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... Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment 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 Quote Link to comment 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. 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.