On Friday 20 December 2002 13:35, Steve Vernon wrote: > MySQL as the filter stupidly does not match SELECT > > Hiya, > How do you get a disctinct value from one collumn only? I am basically > using it to construct a dynamic menu, and need the menu names at a level. > > Items are in one table, like CATEGORY, SUBCATEGORY, SUBSUBCATEGORY, > PAGE, ID > > I could just use SELECT DISCTINCT subcategory FROM placetype WHERE > category='Random' > > But if this subcategory does not have any daughters then I would prefer > to do: > > SELECT DISCTINCT subcategory, page, id FROM placetype WHERE > category='Random' > > But this returns multiple versions becauyse of how distinct works.
What about using GROUP BY subcategory ? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php