Page 1 of 1

select where "conditions" AND code.length == small

Posted: Tue Feb 20, 2007 5:09 pm
by Luke
I need to select from 3 tables where "some conditions" and table1.code is the least amount of characters. Is this possible?

To elaborate, I have products that can be in multiple categories, and I want to grab the category code out of the Product_Category relational table where the category code is the smallest. Thanks! :)

Posted: Tue Feb 20, 2007 5:35 pm
by feyd
ORDER BY CHARACTER_LENGTH(foo)

?

Posted: Tue Feb 20, 2007 5:36 pm
by Luke
nice