[英]SQLite : How to select all, and additionally set a value for some column
我有以下查詢。
@Query("SELECT * FROM sounds GROUP BY artistId ORDER BY artist")
List<Sound> getArtists();
我想選擇全部,然后將isDirectory
設置為對於此查詢中返回的所有行都返回true。
我嘗試了這個:
@Query("SELECT *, " +
"artist AS title," +
"isDirectory AS 'true' " +
"FROM sounds GROUP BY artistId ORDER BY artist").
我意識到這是針對列別名的,有沒有辦法使用類似於AS
的名稱,而不是名稱,而是值。
嘗試使用'true' AS isDirectory
而不要'true' AS isDirectory
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.