See where sqlite two fields?

1

How can I make a query sqlite with where with two fields? Something similar to the following code:

select * from tabla where cap1=1 and cap2=2;

I know that I have to pass on to him, but I do not know how to assemble the whole query.

    
asked by Alldesign Web 18.05.2017 в 00:26
source

1 answer

0

On Android using SQLite you can use this form:

 Cursor cursor =  db.rawQuery("SELECT * FROM tabla WHERE cap1 = ? AND cap2= ?", new String[] {"1", "2"});

Using rawQuery , you define the Query and the selection arguments in an array of strings.

rawQuery(String sqlQuery, String[] selectionArgs)
    
answered by 18.05.2017 / 01:17
source