Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 563
Ahmad Albatsh Avatar asked Feb 12 '26 11:02

Ahmad Albatsh


1 Answers

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 <>.

like image 191
mightyWOZ Avatar answered Feb 15 '26 14:02

mightyWOZ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!