SQL to count the characters of a field if it is less than 10 [closed]

1

I'm having a hard time. I have the following SQL:

$contardescricao  = "0";       
$sqlxmldescricao  = "select id from imoveis where cod = '$cliente' 
                     AND (character_length(descricao)<'10')";
$rsqlxmldescricao = mysql_query($sqlxmldescricao) or die ("Banco XML não abre!");

while($rowxmldescricao = mysql_fetch_array($rsqlxmldescricao))
{
   $contardescricao = $contardescricao + 1;
}  

I'm trying to make it check if the descrição field is less than 10 characters long.

I'm interested in putting together the SQL structure of this record to count the DESCRIPTION field of each record.

Is it possible?

    
asked by anonymous 08.03.2016 / 15:15

1 answer

0

The correct one would be

select id from imoveis where character_length(descricao) < 10
    
08.03.2016 / 20:30