考虑一个表在sqlite中选择唯一记录
results(id,key,value)其中key是主键。
的样本数据:
id | key | value
-----------------------
abc| source-1 | 20
abc| source-2 | 30
abc| source-3 | 2
abc| source-4 | 10
def| source-5 | 1
ghi| source-6 | 25
jkl| source-5 | 13
我想回只有对一个给定id的单次入境的记录。所以输出应该是
id | key | value
------------------------
def| source-5 | 1
ghi| source-6 | 25
jkl| source-5 | 13
请指教。
如果存在重复值('source-5'),'key'如何能成为主键? – beny23