Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
Hi All,

I want to write a query like this:
SELECT Name from DEPT where number == number and Name == Name


I wrote a similar query in SQLite but this does not work:

Cursor c=db.query(viewDepts, columns, deptnumber + deptName+"=?", new String[]{number, Time}, null, null, null);


Need Help ASAP.

Thanks,
Jason
Posted
Updated 23-Apr-11 18:48pm
v2

Take a look at the query [^] and rawQuery [^] documentation. The query methods and the parameter details are listed. You can alternatively also use the rawQuery method, you can pass the sql statement to it with the selection arguments.
 
Share this answer
 
Check out the following link.....
http://mindstick.com/Articles/2643e627-4f5c-45cc-b166-9a9b4c9ff3b1/?Select%20query%20in%20Android%20Application

It will help more to understand about 'select query in android application' or android sqlite database.

Thanks Everyone!!
 
Share this answer
 
v2
check the below link. that will help you to get a better idea about sqlite select and other database operations.
sqlite database operations[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900