Reputation: 21150
I want to delete only the first record (so might be more) that matches my where clause.
E.g.:
delete from `log where colOne=a, colTwo=b;
To illustrate what I mean (I know it's wrong but you will understand immediately what I mean):
delete[1] from `log where colOne=a, colTwo=b;
How do I do this?
Upvotes: 2
Views: 160
Reputation: 2605
q)t:([] a:10?3)
q)t
a
-
1
2
2
1
0
1
2
0
1
1
q)delete from `t where a=0,i=first i
`t
q)count t
9
q)t
a
-
1
2
2
1
1
2
0
1
1
Upvotes: 4