ex. i want to know the character length of a field, so i do a...
mysql> select length(myfield) from mytable;
now if i want to get only those with length exceeding 160 characters, i do a...
mysql> select length(myfield) from mytable where length(myfield) > 160;
right. but have you tried 'having' command? apparently, you can also do a...
mysql> select length(myfield) as fieldlength from mytable having fieldlength > 160;
if you have a very complicated select formula, i'm sure you'll greatly appreciate not having to rewrite it accurately in the where portion of your query
yun lang ;)
No comments:
Post a Comment