2

When I do this in Android:

sqlite> SELECT * FROM secure WHERE name='mock_location' OR value=2.2 ORDER BY value ASC;

I get this:

44|mock_location|1
56|facelock_liveliness_recognition_threshold|2.2

But I want the column names for (*) in the first row, like this:

_id|name|value
44|mock_location|1
56|facelock_liveliness_recognition_threshold|2.2

How can I do that in a single query?

12
  • If you are use it with Cursor . You can get it by java code Commented Apr 28, 2017 at 16:34
  • I can't use Cursor because I am trying to construct the cursor. Commented May 2, 2017 at 7:09
  • Are you using CursorFactory ? Commented May 2, 2017 at 8:08
  • I am extending AbstractCursor. Commented May 2, 2017 at 8:54
  • 3
    try .headers on Commented May 2, 2017 at 10:22

1 Answer 1

2

I did this and it works:

sqlite3 -header /data/data/com.android.providers.settings/databases/settings.db "SELECT * FROM secure WHERE name='mock_location' OR value=2.2 ORDER BY value ASC;"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.