ID 1 2 3 4 5 6 7 8 9 NAME JIM JIM JIM NICK NICK NICK Paul Paul Paul VALUE 20 13 12 10 20 8 4 24 14
我想只显示每个名字的第一条记录.像这样的东西
ID 1 4 7 NAME JIM NICK Paul VALUE 20 10 4
到目前为止,我还没能解决这个问题.我使用sql server 2005任何帮助,将不胜感激…
SELECT ID,Name,Value FROM customer_age WHERE ID IN ( SELECT MIN(ID) AS ID FROM customer_age GROUP BY Name )