SQLite:如何 select 全部,并为某些列另外设置一个值
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();
我想 select 全部,然后将 isDirectory
设置为 return 对于在此查询中 returned 的所有行为真?
我试过了:
@Query("SELECT *, " +
"artist AS title," +
"isDirectory AS 'true' " +
"FROM sounds GROUP BY artistId ORDER BY artist").
我知道这是用于列别名,有没有办法使用类似于 AS
的东西,但不是用于名称,而是用于值。
尝试'true' AS isDirectory
而不是相反
我有以下查询。
@Query("SELECT * FROM sounds GROUP BY artistId ORDER BY artist")
List<Sound> getArtists();
我想 select 全部,然后将 isDirectory
设置为 return 对于在此查询中 returned 的所有行为真?
我试过了:
@Query("SELECT *, " +
"artist AS title," +
"isDirectory AS 'true' " +
"FROM sounds GROUP BY artistId ORDER BY artist").
我知道这是用于列别名,有没有办法使用类似于 AS
的东西,但不是用于名称,而是用于值。
尝试'true' AS isDirectory
而不是相反