Search code examples
androiddatabasesqlitekotlinandroid-room

What is the difference between "=" and "==" in Room queries?


@Query("SELECT * FROM table where age = :age")
fun getAge(age: Int)

@Query("DELETE FROM table where name == :name")
suspend fun deleteName(name: String): Int?

One query uses = and the other uses ==, I wanted to know if there is any difference between them?


Solution

  • There is practically no difference, the equals operator in sqlite has two variations, from SQL Language Expressions

    Note that there are two variations of the equals and not equals operators. Equals can be either = or ==. The non-equals operator can be either != or <>.