Is that better than:
cut -d, -f1,3 data.csv | grep -v '^foo'
I'm sure there are some things where you need sql/q, but this isn't one of them, and there is a lot of utility in productive with bare POSIX tools.