query in mysql with where

2

Hi, I'm trying to make the following query: Find those families that have at least 3 children, and with a maximum age of less than 10 years.

(all fields requested by the query are in the same table)

I have this:

>SELECT * FROM familias WHERE familias.Num_Hijos >=3  
and familias.Edad_HijoMayor =< 10

but I do not know the correct syntax.

    
asked by Bet Rosas 29.11.2018 в 02:34
source

1 answer

2

Given your statement Find those families that have at least 3 children, and with a maximum age of less than 10 years. , I would only leave the query like this:

SELECT * FROM familias WHERE familias.Num_Hijos >= 3  
and familias.Edad_HijoMayor < 10

That is to say familias.Edad_HijoMayor < 10 because it will only take into account children who are less than 10 years old, because you had put = < which is not a valid syntax p>

Comparison operators should be like this

  • < = that is less than or equal
  •   

    = that is greater than or equal to

  • < which is less than
  •   

    which is greater than

  • answered by 29.11.2018 / 02:39
    source