通过rowNo函数定位需要更新的位置,然后批量更新。
以下例子可以帮助理解这个问题:
sym = `C`MS`MS`MS`IBM`IBM`C`C`C$SYMBOL price= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 qty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 timestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12] t1 = table(timestamp, sym, qty, price); t1; update t1 set rowNum = rowNo(sym) items = exec rowNum from t1 context by sym limit 1 update t1 set price=qty where rowNum in items["rowNum"] dropColumns!(t1, `rowNum)