DISTINCT 在 sqlite 查询 android 中不起作用

DISTINCT is not working in sqlite query android

提问人:Sweta 提问时间:11/10/2023 更新时间:11/10/2023 访问量:43

问:

 """select distinct "data" from (select * from "DemoName" inner join "patient" on "DemoName"."rowid" = "patient"."rowid" where "patient"."name" LIKE '%$pattern%' and length('$pattern') <= length("patient"."name") and "patient"."archived" = 'false'
                 union
                select * from "DemoName" inner join "patient" on "DemoName"."rowid" = "patient"."rowid" where "DemoName"."word" match '$pattern*' and "patient"."archived" = 'false' and score < 800 and top = 30
                ) ORDER BY CASE  WHEN name LIKE '$pattern%' THEN 0 WHEN name LIKE '%$pattern%' THEN 1 ELSE score END LIMIT 80""".trimIndent()
   

这是我用于搜索非重复的查询。但是由于联合运算符,我在此查询中获得了重复的值

android sql sqlite android-sqlite

评论


答: 暂无答案