I'm trying to build a query for Room DB that finds all items except for a specific id. Well, no luck so far. I've tried both != and <> and the id is still coning through.
Query examples:
@Query("SELECT * FROM <table name> WHERE _id!=:id AND team=:team")
@Query("SELECT * FROM <table name> WHERE _id<>:id AND team=:team")
Any help is greatly appreciated.
Okay, so both != and <> do work for creating a Query where you want to exclude something that is not equal to the parameter that you're passing in. My issue was that I was running 2 separate queries concurrently and one of them need the id passed from the other. Changed the code to run one after the other finishes and all is good now.
Thanks again!
JP
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With