Jump to content


Photo

Php Mysql "select" Question


  • Please log in to reply
2 replies to this topic

#1 shai1

shai1
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 29 June 2006 - 06:07 PM

Is there a way I can do a select that will return the records with a character count less then a specific number?

i.e. select * from table where character count of textField<=30
You always get to choose your own lunch!
http://studio55salononline.com

#2 jworisek

jworisek
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 29 June 2006 - 06:26 PM

try this...

SELECT * FROM table_name WHERE LENGTH(column_name)<=30;

[!--quoteo(post=389369:date=Jun 29 2006, 01:07 PM:name=shai1)--][div class=\'quotetop\']QUOTE(shai1 @ Jun 29 2006, 01:07 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Is there a way I can do a select that will return the records with a character count less then a specific number?

i.e. select * from table where character count of textField<=30
[/quote]


#3 shai1

shai1
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 29 June 2006 - 06:43 PM

This is EXACTLY what I was looking for. Thanks so much!

I love internet forums! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

[!--quoteo(post=389377:date=Jun 29 2006, 01:26 PM:name=jworisek)--][div class=\'quotetop\']QUOTE(jworisek @ Jun 29 2006, 01:26 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
try this...

SELECT * FROM table_name WHERE LENGTH(column_name)<=30;
[/quote]

You always get to choose your own lunch!
http://studio55salononline.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users