看起来很简单,但对我来说很困难。 idx 1,2,3的src/dest路径具有相同的值。 所以我只需要1排他们。分组在多列
idx Src_path dest_path code
1 /abc/aaa.txt /abc/dec_aaa.txt 01
2 /abc/aaa.txt /abc/dec_aaa.txt 02
3 /abc/aaa.txt /abc/dec_aaa.txt 03
4 /abc/aaa.txt /abc2/dec_aaa.txt 04
5 /abc/bbb.txt /abc2/dec_bbb.txt 01
6 /abc/ccc.txt /abc2/dec_ccc.txt 01
the result rows should be like below..
idx Src_path dest_path code
3 /abc/aaa.txt /abc/dec_aaa.txt 03
4 /abc/aaa.txt /abc2/dec_aaa.txt 04
5 /abc/bbb.txt /abc2/dec_bbb.txt 01
6 /abc/ccc.txt /abc2/dec_ccc.txt 01
位..我很难..
,但他们有不同的_code_ ..是不是? – asifsid88 2013-02-22 06:45:25
选择'MAX(code)',然后使用'GROUP BY Src_path,dest_path'。 – 2013-02-22 06:46:00
是的......他们有一个不同的代码。我可以忽略他们的代码。 – 2013-02-22 06:47:07