在 SQLite3 输出中打印列名以及查询结果
Print column names in SQLite3 output along with query results
当我在 Android 中执行此操作时:
sqlite> SELECT * FROM secure WHERE name='mock_location' OR value=2.2 ORDER BY value ASC;
我明白了:
44|mock_location|1
56|facelock_liveliness_recognition_threshold|2.2
但我想要第一行中 (*) 的列名,如下所示:
_id|name|value
44|mock_location|1
56|facelock_liveliness_recognition_threshold|2.2
如何在单个查询中执行此操作?
我这样做了并且有效:
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;"
当我在 Android 中执行此操作时:
sqlite> SELECT * FROM secure WHERE name='mock_location' OR value=2.2 ORDER BY value ASC;
我明白了:
44|mock_location|1
56|facelock_liveliness_recognition_threshold|2.2
但我想要第一行中 (*) 的列名,如下所示:
_id|name|value
44|mock_location|1
56|facelock_liveliness_recognition_threshold|2.2
如何在单个查询中执行此操作?
我这样做了并且有效:
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;"