2015-11-29 61 views
-3

嗨,我有一個16k +條目sql到csv轉儲格式如下。我需要保留每個日期的第一個實例並刪除重複的日期。因此,只需要保留2010-01-19的第一個值並刪除以下重複項等等。重複的日期字符串刪除,第一個實例需要停留

解決方案歡迎grep,搜索&替換或sql導出命令。謝謝!!

"2010-01-19","Ciorba de fasole cu carne de curcan si smantana",,"10" 
"2010-01-19","Quiche cu mozzarella, rosii si busuioc",,"9" 
"2010-01-19","Quiche lorraine",,"9" 
"2010-01-19","Tagliatele cu pui, sos de soia, miere si coriandru",,"12" 
"2010-01-19","Sandwich cu somon afumat, unt si chives",,"8" 
"2010-01-19","Sandwich cu humus, ruccola si muguri de pin",,"8" 
"2010-01-19","Sandwich cu cheddar, salam chorizo si ruccola",,"8" 
"2010-01-19","Tarta bakewell cu migdale",,"8" 
"2010-01-19","Cheesecake cu portocale",,"8" 
"2010-01-20","Quiche cu branza si praz",,"9" 
"2010-01-20","Quiche lorraine",,"9" 
"2010-01-20","Placinta de mere",,"8" 
"2010-01-20","Prajitura cu morcovi",,"8" 
"2010-01-20","Sandwich cu cheddar, jamon serrano si ruccola",,"8" 
"2010-01-20","Sandwich cu somon afumat, unt si chives",,"8" 
"2010-01-20","Sandwich cu branza de capra si chutney de ceapa",,"8" 
"2010-01-20","Supa crema de ceapa cu crutoane",,"9" 
"2010-01-20","Quesadilla cu carne de vita si salata de bulgur cu menta",,"12" 
"2010-01-21","Supa crema de telina cu parmezan",,"9" 
"2010-01-21","Placinta de nuci",,"8" 
"2010-01-21","Sandwich cu cheddar, jamon serrano si ruccola",,"8" 
"2010-01-21","Sandwich cu cheddar, salam chorizo si ruccola",,"8" 
"2010-01-21","Sandwich cu humus, ruccola si muguri de pin",,"8" 
"2010-01-21","Sandwich cu branza de capra si chutney de ceapa",,"8" 
"2010-01-21","Quiche cu praz",,"9" 
"2010-01-21","Chicken curry cu orez",,"12" 

回答

0

嘗試類似:

DELETE FROM Table 
WHERE ID NOT IN 
(
SELECT MIN(ID) 
FROM Table 
GROUP BY Field1, Field2, Field3, ... 
) 
相關問題