Start a new topic

Database query with more than one condition

I'm needing to know how can I do a database quey with more than one condition.

I mean using a "select" with more than one filter, what we use in mysql like a simple "And" next the "where" of the first condition.
1 Comment

Hey,



You can chain together calls on the query builder, and they will all be added to the query.



for example:



Query myQuery = new Query().equals("firstName", "John").equals("lastName", "Smith");



will query for entities where firstName is John and lastname is Smith.
Login or Signup to post a comment